-
Notifications
You must be signed in to change notification settings - Fork 279
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow smarter weights (cubes, coordinates, cell measures, or ancillar…
…y variables) for aggregation (#5084) * First implementation for smarter weighted aggregation * Allowed arbitrary _DimensionalMetadata for weights * Added tests * Added units argument to constructor of Weights * Added documentation * Fixed tests and added Weights class to API doc * Fixed tests again * Fixed bug which lead to errors when weights was explicitly set to None * Fixed bug in doc * Try 1 to fix doctest * Do not import inherited functions for Weights anymore to avoid doctest failures * Made Weights class private * Suggestions from code review * Split tests into smaller parts * Re-wrote TestWeights as pytest test * Spellcheck * Added test for _sum_units_func * Ensure backwards-compatibility of Aggregator.units_func * Restored import order of test * Added What's new entry * Split further tests * Optimized What's new entry * Apply suggestions from code review Co-authored-by: lbdreyer <lbdreyer@users.noreply.github.com> * obj cannot be None in _Weights.__array_finalize__ * Removed whitespace --------- Co-authored-by: lbdreyer <lbdreyer@users.noreply.github.com>
- Loading branch information
Showing
10 changed files
with
991 additions
and
52 deletions.
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
Oops, something went wrong.