-
Notifications
You must be signed in to change notification settings - Fork 19
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
compatibility with xr.DataTree #607
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #607 +/- ##
==========================================
- Coverage 80.44% 80.29% -0.16%
==========================================
Files 49 50 +1
Lines 3079 3121 +42
==========================================
+ Hits 2477 2506 +29
- Misses 602 615 +13
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The upstream packages seem flaky |
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.
Wow thanks, that is a lot of work! I think it's okay not to support xarray-datatree
at all then, since it is not recommended to use it anyway.
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.
Thanks. It was mostly annoying because 98 % I did not understand what is happening 🤷♂️
As long as we need to patch xr.map_over_datasets
we can just as well support datatree (because we need to import from _datatreecompat anyway.
It's annoying that the new version has become so bothersome to work with 😒
|
||
# https://github.com/pydata/xarray/issues/10013 | ||
# tas_anoms = dt - ref.ds | ||
tas_anoms = map_over_datasets(operator.sub, dt, ref.ds) |
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.
This takes all the fun out of using xr.DataTree
and cannot be expected from a user. The other 'issues' (missing methods) will probably be fixed in time but this seems to be a design decision. 👎
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.
Yes I agree.
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 think what we have to do is write a helper function calc_anomaly(dt, ref_period)
with this inside.
I have not yet updated the example scripts and we need to fix the pin for xarray (so it's not only tested in upstream-dev ci). |
I opened pydata/xarray#10042 - there seems to be some willingness to enable skipping empty nodes. With this change we could avoid the But not super convinced this PR gets a fast turnaround 😒 |
Ah yes and after 507cd1c this definitely requires xarray main, i.e. we require
(thats probably not a valid specifier) |
Should we merge this branch? I'm quite blocked now, because I'm trying to use the former datatree, but knowing that we will use this PR... |
Actually, there are no imports in the init.py of mesmer.core. Should we add a commit doing the following?
|
I can merge (but see my next comment), or you can use the old version and I'll update it later. |
Users don't really need to access functions in |
This is not moving forward on xarrays site, so I am merging. I will merge +- as is. Open a PR for a |
I also have to find out if |
And we can always remove the compatibility |
CHANGELOG.rst
Adds compatibility with
xr.DataTree
. Works (at least locally) but is not finished and needs some ugly workarounds due to some design decisions in the new version... The new code path is only tested in upstream-dev ci.I am not sure we should support both, datatree and xarray datatree, but this was actually the smaller part of the whole operation.