Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusing error message for non-matching dtype of edges for binning or groups for gouping. #3317

Open
YooSunYoung opened this issue Nov 7, 2023 · 1 comment

Comments

@YooSunYoung
Copy link
Member

When I tried to test integer edges and groups, I got this error message like below.
As I was looking into the c++ code, I knew that it was because the dtype of the target coordinate and the given edges don't match.
However, I think it might be hard to understand for users who only have access to the python layer.
grouping gives similar error message.

edges = sc.linspace('x', 0, 100, 101, unit='m', dtype=int)
table = sc.data.table_xyz(10_000)*100
table.bin(x=edges)

# DTypeError: 'scipp.bin.update_indices_by_binning_linspace' does not support dtypes 'int32', 'float64', 'span_const_int64', 

Should we improve the error message by checking the dtype of the given edges or groups in the earlier place...?

@SimonHeybrock
Copy link
Member

We just fixed a similar issue for hist in #3298. Maybe we should adopt a similar approach here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants