-
Notifications
You must be signed in to change notification settings - Fork 89
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
fix: carry parameters through broadcasting #1679
Conversation
This introduces new parameter broadcasting modes: - `INTERSECT` - `ONE_TO_ONE` - `ALL_OR_NOTHING` - `NONE` The previous default was `None`. The meaning of these broadcasting modes, set using the `"broadcast_parameters_rule"` option key, can be found in the source code.
Codecov Report
Additional details and impacted files
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed this on Zoom; I think this is a great solution!
The Sentinel will be moving to _util (:checkmark:).
I think the strings should be lower-case, at least when they are arguments to ak.transform
(not done yet). It would be fine for the Enums to be upper-case (they're constants) while the strings that represent them are lower-case. It would also be fine to use just strings and not Enums. (This would be the first use of Enum.)
OK, I think this is ready to go. I want to, in a future PR, increase the coverage of these test. Right now, we have enough to consider merging this PR. |
Fixes #1672
@jpivarski and I discussed the ramifications of this on Zoom. We have always been setting the parameters to None in
This PR introduces a new
broadcast_parameters_rule
enumeration that selects from the following rules:"intersect"
Take the intersection of the broadcasted input parameters.
"all_or_nothing"
Take the first content's parameters if they are equal to all of the other content's parameters, otherwise
None
."one_to_one"
Assert that the broadcast output matches the broadcast inputs, and if so, take the corresponding parameters (by position).
"none"
Always set parameters to
None
(previous behaviour)