xpublish-community / xpublish

Publish Xarray Datasets via a REST API.
https://xpublish.readthedocs.io
Apache License 2.0
167 stars 23 forks source link

Set default ZarrPlugin prefix to /zarr #188

Closed abkfenris closed 1 year ago

abkfenris commented 1 year ago

Closes #182

abkfenris commented 1 year ago

@jhamman I might need some Zarr help here. It looks like it's failing as the non-dimension coordinate order isn't matching in the metadata tests.

I haven't been able to replicate it against Python 3.9.15, Xarray 2023.4.2, Zarr 2.14.2 (or 2.11.3 before I bumped Zarr to see if that was mismatched) locally. I didn't see anything in Xarray or Zarr's changelog that made me think that there would be a change in either that would affect the ordering of lat and lon.

jhamman commented 1 year ago

I re-triggered the failed CI and things past. Not sure what was up with the previous failed run but I'm wondering if it had picked up an old/malformed cache.

jhamman commented 1 year ago

Oh, do we need some doc updates with this?

abkfenris commented 1 year ago

It just failed the same way when landing the pydata-theme PR. I'm going to try explicitly sorting the coord names to see if that helps make the ordering of coords predictable at least from Xpublish's side.

And yes, because I had big doc changes in flight I'm going to make the updates there #180.

abkfenris commented 1 year ago

Ok, so we are sorting coordinates, but Xarray/Zarr isn't?

abkfenris commented 1 year ago

And that also passes when run again.

abkfenris commented 1 year ago

It looks like xarray sets the value here, and I can't make out any sorting which would make it stable. https://github.com/pydata/xarray/blob/25d9a28e12141b9b5e4a79454eb76ddd2ee2bc4d/xarray/conventions.py#L690-L697