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] Throw error when filling Int64 with negative weight #618

Closed
andrzejnovak opened this issue Jul 26, 2021 · 1 comment · Fixed by #641
Closed

[BUG] Throw error when filling Int64 with negative weight #618

andrzejnovak opened this issue Jul 26, 2021 · 1 comment · Fixed by #641

Comments

@andrzejnovak
Copy link
Member

andrzejnovak commented Jul 26, 2021

import numpy as np
import hist

h = hist.Hist.new.Reg(50, -5, 5).Int64().fill(np.random.randn(100))
h.fill(3, weight=-1)
h.plot();

image

Filling negative weights to the wrong storage type gives a silent error. This should either give a warning or just not be allowed at all.

@henryiii
Copy link
Member

Fixed by #636, I think, but can add a test.

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

Successfully merging a pull request may close this issue.

2 participants