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] axis.index finds wrong index when giving integer values #455

Open
mpad opened this issue Oct 6, 2022 · 0 comments
Open

[BUG] axis.index finds wrong index when giving integer values #455

mpad opened this issue Oct 6, 2022 · 0 comments

Comments

@mpad
Copy link

mpad commented Oct 6, 2022

the axis.index() function returns incorrect index when passed particular integer values.

Steps to reproduce
Running under linux (fedora 35, python 3.6.10)

>>> hist.__version__
'2.6.2'
>>> a=hist.axis.Regular(50,0,50)
>>> [(i,a.index(i)) for i in range(28,31) ]
[(28, 28), (29, 28), (30, 30)]

I expect to obtain (29,29) as the 2nd entry as any other integer in the range 0..50 .
With decimals, it works as expected :

>>> [(i,a.index(i+0.001)) for i in range(28,31) ]
[(28, 28), (29, 29), (30, 30)]
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

1 participant