-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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/apply ufunc meta dtype #4022
Closed
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ad5a3f4
add tests
mathause ba73f16
update apply_ufunc
mathause f154d1c
whats new
mathause 9514f56
Merge branch 'master' into fix/apply_ufunc_meta_dtype
mathause 303cef1
add warning
mathause db5913a
combine if statements
mathause 1e7256a
Merge branch 'master' into fix/apply_ufunc_meta_dtype
mathause File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
shouldn't we still set
meta = np.ndarray
if no output dtype is specified?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.
output_dtypes
is required fordask="parallelized"
and will error if it is missing:xarray/xarray/core/computation.py
Lines 670 to 674 in 8051c47
so this wont take effect. I am also not very happy with my approach, but didn't want to copy the checks from
apply_blockwise
up here - suggestions?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.
Maybe the cleaner workaround is to move this down in to
_apply_blockwise
? Would it be enough to passvectorize
down to that level and then setmeta
as you are doing here?Also, it seems like we should raise that error about
output_dtypes
only ifmeta.dtype
has not been set?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.
Yes, I agree it would be cleaner to thread
vectorize
through to_apply_blockwise
.Depends how important
output_dtypes
is fornp.vectorize
.I am happy to work more on this, but I think it would be good to discuss #4060 first, which might make this obsolete.