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

[BUG] Filling with unsigned ints in IntCategory axis raises TypeError #898

Open
tcuisset opened this issue Nov 21, 2023 · 1 comment
Open

Comments

@tcuisset
Copy link

Describe the bug
Filling an histogram with unsigned ints in IntCategory axis raises TypeError : "Only integer arrays supported when targeting integer axes". I believe this used to work in version 1.3

Steps to reproduce

import boost_histogram as bh
import numpy as np
h = bh.Histogram(bh.axis.IntCategory([0, 1]))
h.fill(np.array([0], dtype="int32")) # works
h.fill(np.array([0], dtype="uint32")) # raises TypeError :  "Only integer arrays supported when targeting integer axes"
@henryiii
Copy link
Member

It worked incorrectly for floats. I’d agree that uint would be nice to supported, though it will be doing a conversion internally since the fill routines are compiled with 64 bit signed ints. At the very least the error message can be improved.

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