Repository navigation
Document map_over_datasets callback outputs - #11931
Open
Arham-Begani wants to merge 1 commit into
Open
Arham-Begani wants to merge 1 commit into
Arham-Begani wants to merge 1 commit into
Conversation
Co-authored-by: OpenAI Codex <noreply@openai.com>
|
Thank you for opening this pull request! It may take us a few days to respond here, so thank you for being patient. |
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Closes #10053.
The documentation of
map_over_datasetsdid not match what the function accepts.DataTree.map_over_datasetssaid the function "needs to return a Dataset".xr.map_over_datasetsmentionedNonein one paragraph but said in its parameter docs that the function "must accept at least one Dataset and return at least one Dataset". The user guide said it must return newDatasetobjects. In practice the function can also returnNone, which keeps the node in the result without local data, or a fixed-length tuple of Datasets andNones, which produces one tree per position.This PR updates both docstrings and the user guide to describe those return values, and adds two examples to
xr.map_over_datasets:Noneat the root drops the root dataset but keeps the root path and its/stationchild (readings.groups == ('/', '/station'), with no data variables at the root).(ds.min(), ds.max())at every node produces two trees, holding the minimum and maximum/stationtemperatures (8 and 12).AI Disclosure
Tools: OpenAI Codex helped draft the documentation and examples and ran the documentation test. Claude Code wrote this PR description.