Conversation
adds UxDataset.zonal_mean, zonal_average, zonal_anomaly, azimuthal_mean, azimuthal_average, weighted_mean (see #1800). improves UxDataArray.zonal_mean docstring. fixes UxDataArray.weighted_mean bugs (see #1800) and improves its docstring. Adds private methods: _grid_dims and _grid_dim, and UxDataset._apply_across_data_vars
(sidenote: some UxDataset.weighted_mean tests are already covered by test_weighted_mean.py)
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
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.
Closes #1801 (sub-issue of #1734)
Closes #1800
Overview
Solves #1801 by implementing
UxDataset.zonal_mean(),.zonal_average(),.zonal_anomaly(),.azimuthal_mean(),.azimuthal_average(), and.weighted_mean(). These use the newUxDataset._apply_across_data_varshelper function, which should be very useful when addressing other sub-issues of #1734.Solves #1800 by updating weighted_mean code and docstring accordingly.
Corresponding readthedocs notebooks have been updated to include these new features, with simple examples for zonal_mean and azimuthal_mean, and a more detailed example for weighted_mean. Added relevant tests into
test_dataset.pyandtest_weighted_mean.py.Expansions of scope:
Sidenote: I didn't make any edits to the bottom of the zonal-average.ipynb (lines 700+) myself, those are all from automatic ruff formatting.
Expected Usage
PR Checklist
General
Testing & Benchmarking
Documentation and Examples
docs/api.rst; internal (private) function names start with an underscore (_)AI Disclosure
AI Usage: Claude mostly just to settle on design for the new helper function; GitHub Copilot's inline code suggestions.