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

Fixing category indexing #298

Merged
merged 1 commit into from
Jan 6, 2020
Merged

Fixing category indexing #298

merged 1 commit into from
Jan 6, 2020

Conversation

henryiii
Copy link
Member

@henryiii henryiii commented Jan 3, 2020

Fix issues with indexing and summing category axes. You can now sum over a category axes again (regression in 0.6.0), and you can select a single item from a category axes just like you can from other axes types.

Fixes #297, improves #296 (single item selection now works on a category axis).

This may be improved upstream in Boost.Histogram later, in which case this can be simplified eventually.

@henryiii
Copy link
Member Author

henryiii commented Jan 3, 2020

@HDembinski Let me know if this seems like a reasonable workaround for 0.6.2; I assume Boost.Histogram will later add utilities that will make this easier. A single item no longer becomes a slice of length 1, and the trick shown on Gitter is used to produce the output. This also fixes sums over category axes, which were trying to slice in 0.6 and so were failing.

TODO: This internally tests sums over category axes in the tests now, but that should be added as an explicit test in the future to be safe when the algorithm changes.

@henryiii henryiii merged commit 1cbd74a into develop Jan 6, 2020
@henryiii henryiii deleted the henryiii-catind branch January 6, 2020 21:23
@henryiii henryiii added this to the 0.6.2 milestone Jan 7, 2020
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 this pull request may close these issues.

Fix summing over category axes
1 participant