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.
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
Feature/weighted #2922
Feature/weighted #2922
Changes from 20 commits
0f2da8e
5f64492
685e5c4
c9d612d
a20a4cf
26c24b6
f3c6758
25c3c29
5d37d11
b1c572b
d1d1f2c
6be1414
059263c
8b1904b
8cad145
49d4e43
527256e
739568f
f01305d
2e3880d
ae8d048
dc7f605
c646568
e2ad69e
bd4f048
3c7695a
ef07edd
064b5a9
fec1a35
72c7942
0e91411
1eb2913
118dfed
e08c921
0fafe0b
a8d330d
ae0012f
111259b
5afc6f3
668b54b
d877022
ead681e
c4598ba
866fba5
3cc00c1
8f34167
9f0a8cd
98929f1
62c43e6
2e8aba2
d14f668
7fa78ae
3ebb9d4
f01d47a
4b184f6
1e06adc
706579a
b2718db
4c17108
8acc78e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 remove as
xr.dot
does not provide thisThere 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.
Agree re removing (or am I missing something—why was this here?)
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.
For consistency it would be nice to offer
axis
here. Originallysum
was implemented as(weights * da).sum(...)
and we gotaxis
for free. Withdot
it is not as straightforward any more. Honestly, I never useaxis
with xarray, so I suppose it is fine to only implement it if anyone would ever request it...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.
OK. Unless I'm missing something, let's remove
axis
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.
I'm sure you're right, but can you help me understand the issue here? Doesn't each of
dot
andsum
collapse all dimensions ifdims=None
? Or there's an issue where only a subset of the dimensions are shared?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.
bool
works withdot
from my limited checksThere 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.
Should we just put these on the
Weighted
object? (not a huge deal, trying to reduce indirection if possible though)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.
Do you mean like so?
Yes good idea, this might actually even work better as this avoids the hassle with the non-sanitized
weights
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.
?
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.
Not for this PR, but we do this lots of places; we should find a common approach at some point!
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.
Will this work if
coords
are on dimensions that are reduced / removed by the function?