-
Notifications
You must be signed in to change notification settings - Fork 32
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
DRAFT: Weighted Average #833
base: main
Are you sure you want to change the base?
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
I've set up the boilerplate for the weighted mean functionality. This should be a good place to get started. We can run over this during today's meeting. |
We have fixed the issue with the |
ASV BenchmarkingBenchmark Comparison ResultsBenchmarks that have improved:
Benchmarks that have stayed the same:
Benchmarks that have got worse:
|
…rray/weighted-mean (#866) * updated mean function with weighted arg * updated weighted-mean functionality in dataarray.py * edited weights to dask array --------- Co-authored-by: Rachel Yuen Sum Tam <rtam@dec2454.hsn.de.hpc.ucar.edu> Co-authored-by: Rachel Yuen Sum Tam <rtam@crhtc38.hpc.ucar.edu>
nt.assert_equal(result, expected_weighted_mean) | ||
|
||
|
||
def test_csne30_equal_area(): |
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.
weighted_mean = (self * weights).sum(axis=-1) / total_weight | ||
|
||
# create a UxDataArray and return it | ||
return UxDataArray(weighted_mean, uxgrid=self.uxgrid) |
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.
Need to preserve other parameters:
- Coordiantes
Closes #826
Overview
Expected Usage
PR Checklist
General
Testing
Documentation
_
) and have been added todocs/internal_api/index.rst
docs/user_api/index.rst
Examples
docs/examples/
folderdocs/examples.rst
toctreedocs/gallery.yml
with appropriate thumbnail photo indocs/_static/thumbnails/