-
Notifications
You must be signed in to change notification settings - Fork 283
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
Xarray bridge #4994
Comments
#5024 is the beginnings of a new approach to this. |
Is there something missing in Xarray's |
Not really as such, but there is quite a list of features that we can't get from that which we'd like. I haven't really looked into the differences between
We also think there are probably some tricky corners relating to masked/missing data and time-values handling (with more obscure non-standard calendars). But those one can mostly at least work around, by turning off interpretation in xarray. So, "tactically" here, the elephant in the room is that |
ping @TomekTrzeciak FYI |
@pp-mo I have to say - and following on from @dcherian's very good point - that I'd prefer any work to improve the Iris-XArray bridge to be done as enhancements to the functionality that already exists within XArray, rather than being added as new functionality within Iris. I think it would be confusing for users to have multiple APIs for this at all (e.g. @dcherian to add to @pp-mo's very detailed answer above, the main thing is that the round-trip (that is Iris - XArray - Iris) results in a different end object to what was started with. Apologies - we've been meaning to contribute to XArray's Iris bridge with Iris-perspective updates so that the round-trip is lossless for years, because the functionality is super useful, but unfortunately other work pressures have always blocked us doing so 😑 |
I fully understand :) That said, given all the subtle details in @pp-mo's answer, perhaps this code would fit better, and be better maintained, in Iris than in Xarray. Note that pandas to xarray conversion code lives in xarray and pandas just calls that. So we could just have |
ping @jacobtomlinson, to whom I mentioned this work earlier |
Latest ideas on this, are for it to become a new independent repo "scitools/ncdata" A key idea is that it exists in its own space, with no required dependency on either Xarray or Iris |
Current status : I have functional code, and we have pretty much decided now on a plan...
Frankly though, this will take a while to establish properly : I have as yet no home repo, no tests written + plenty of other priorities getting in the way. |
Key spoiler alert : I believe this will now work without requiring any changes to Xarray. I know that @TomekTrzeciak was generally pessimistic about getting xarray to be fully transparent for round-trips. |
Update : Please note that this contains a link to the private "Xarray WIP" PR, i.e. "NcData within Iris" |
Is this intended to be an alternative way to the normal iris.load/iris.save way for loading/saving netCDF data, or do you imagine that in the future iris will build on this? |
No, I think we're seeing this only as an alternate route where special needs apply. What happens in Iris is all much the same, since Iris treats it as netcdf load+save (not a new format). |
@pp-mo If you (or anyone else too!) are interested, we have our regular Bi-weekly Xarray meeting next week on Feb 1, 2023. I think your plan could make for very interesting discussion. |
Thanks for the suggestion - I imagine that might be useful. |
I think just a brief overview of your plans and any feedback you'd like. You could talk through it, the meeting is meant for quick in-person iteration, and is quite informal. (cc @pydata/xarray) PS: Unfortunately, I'll be out of town. |
Latest approaching Iris 3.7
|
Status update 2023-01-05My latest solutions are now here : https://github.com/pp-mo/ncdata I've just added packaging and made available on PyPi, conda-forge pending. |
@pp-mo, sweet to see this progressing and taking shape and also your ideas from ncobj being taken forward 👍. |
Provide a bridge to convert data to+from Xarray
Enable use of Iris+Xarray together, with fast+efficient exchange between the two.
Primary Goals:
Roughly following the ideas (
#4835now F-B https://github.com/SciTools/iris/tree/FEATURE_xarray_readwrite )And especially to enable possible solutions listed in this comment
Also relevant (to lazy data) : ideas in pp-mo/iris#73
But NB while functional, this approach is very clunky : see generally simpler scheme suggested here
Tasks
The text was updated successfully, but these errors were encountered: