Skip to content
New issue

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

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

Already on GitHub? # to your account

fix: axis passthrough #980

Merged
merged 1 commit into from
Feb 3, 2025
Merged

fix: axis passthrough #980

merged 1 commit into from
Feb 3, 2025

Conversation

henryiii
Copy link
Member

Followup to #977. Uses the new axes if one is provided.

I wonder if we should allow axis + other args, if someone wants to use a new axis with a custom mapping?

We'll have to work out the correct mapping for flow bins for the four cases.

@github-actions github-actions bot added the needs changelog Might need a changelog entry label Jan 31, 2025
@henryiii
Copy link
Member Author

henryiii commented Feb 3, 2025

What would you expect to happen if you rebin an axis that doesn't have flow? Specifically:

h = bh.Histogram(bh.axis.Regular(5, 0, 5, underflow=False, overflow=False))
h.fill([-1, 1.1, 2.2, 3.3, 4.4, 5.5])
hs = h[bh.rebin(edges=[0, 3, 5.0])]

Should hs.axis[0] have flow bins?

@henryiii
Copy link
Member Author

henryiii commented Feb 3, 2025

Actually, I think it should match rebin(2), which matches the original. :)

@henryiii henryiii force-pushed the henryiii/fix/rebin_axis branch from d8eb453 to 24032d8 Compare February 3, 2025 19:55
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
@henryiii henryiii force-pushed the henryiii/fix/rebin_axis branch from 51a1ea9 to 68670a1 Compare February 3, 2025 20:03
@henryiii henryiii marked this pull request as ready for review February 3, 2025 20:55
@henryiii henryiii changed the title WIP: fix axis passthrough fix: axis passthrough Feb 3, 2025
@henryiii henryiii merged commit 39ca0e3 into develop Feb 3, 2025
17 checks passed
@henryiii henryiii deleted the henryiii/fix/rebin_axis branch February 3, 2025 22:33
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
needs changelog Might need a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant