-
Notifications
You must be signed in to change notification settings - Fork 23
dask: Data.where
#260
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
dask: Data.where
#260
Conversation
sadielbartholomew
left a comment
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.
I think a rogue line, or a missed parameter from a typo, might have slipped into the new where docstring examples, but otherwise this is all good. The new unit tests are sound and pass for me locally.
| shape_x = x.shape | ||
| shape_data = data.shape | ||
| for n, m in zip(shape_x[::-1], shape_data[::-1]): | ||
| if n != m and n != 1: |
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.
Potentially my thought as follows would be premature optimisation, so maybe if anything it could be a tentative TODODASK comment, but could this logic be refactored to avoid the need to calculate the shape of the data in the cases across where x has only size-1 dimensions? In other words, to essentially change the short-circuiting on the if check here to:
| if n != m and n != 1: | |
| if n != 1 n != m: |
in case x is trivial and data is not, notably if it is large so expensive to get its shape? Would that even be worthwhile or could it e.g. be a niche case with general usage of the where method (not sure right now, thinking aloud here)?
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.
Can we talk about this one on out next call?
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.
@davidhassell, sure. I'll add it to my (sprawling) questions and thoughts list.
sadielbartholomew
left a comment
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.
Great, thanks! (There are some new left conflicts to resolve, but please go ahead and merge after they have been addressed.)
Includes in
cf.Querya bug-fix and new utility methodset_condition_units.