Skip to content

Conversation

jbusecke
Copy link
Collaborator

@jbusecke jbusecke commented Sep 18, 2025

I am working towards icechunk (for now likely just native) support in titler-multidim here.

Depends on #95

Tasks

  • Updated zarr to v3
  • Modified the test fixture scripts to write v2 and v3 zarr stores explicitly (I retriggered them and committed the new fixtures)
  • Add scripts/fixtures for native icechunk

@jbusecke
Copy link
Collaborator Author

jbusecke commented Sep 18, 2025

I noticed that some tests fail with

E           TypeError: cannot pickle 'module' object

in the XarrayReader

This seems to only happen with caching is enabled (and only for the netcdf store)! To show this I have added an additional parametrization to the app test fixture which runs all tests both with and without cache.

I did confirm that this error is introduced with the upgrade of either xarray or zarr here. When I just add the changes to conftest.py to main, all tests pass, so this was not a silent failure.

Ill move on here for now, but I would love to fix this issue here. @hrodmn do you have any intuition why the caching would not play nice with a new xarray or zarr version?

@jbusecke
Copy link
Collaborator Author

jbusecke commented Sep 18, 2025

Ok making some progress here, but Ill need some input from folks.

I have refactored the test datasets for zarr v2 and v3. The reading in seems to work (since the tests to get the variables only do pass), but I have some questions about the expected responses.

when I run the test_get_info pytest I am not getting the expected response (left is returned and right is expected).

FAILED tests/test_app.py::test_get_info[without_cache-zarr_store_v3] - AssertionError: assert {'bounds': [-180.0, -90.0, 180.0, 90.0], 'crs': 'http://www.opengis.net/def/crs/EPSG/0/4326', 'band_metadata': [['b1', {}]], 'band_descriptions': [['b1', '0']], 'dtype': 'float64', 'nodata_type': 'Nodata', 'name': 'CDD0', 'count': 1, 'width': 72, 'height': 36, 'dimensions': ['y', 'x'], 'attrs': {}} == {'bounds': [-180, -90.0, 180.0, 90.0], 'band_metadata': [], 'band_descriptions': [], 'dtype': 'float64', 'nodata_type': 'None', 'height': 36, 'count': 1, 'width': 72, 'attrs': {}, 'name': 'CDD0'}
  
  Common items:
  {'attrs': {},
   'bounds': [-180.0, -90.0, 180.0, 90.0],
   'count': 1,
   'dtype': 'float64',
   'height': 36,
   'name': 'CDD0',
   'width': 72}
  Differing items:
  {'nodata_type': 'Nodata'} != {'nodata_type': 'None'}
  {'band_descriptions': [['b1', '0']]} != {'band_descriptions': []}
  {'band_metadata': [['b1', {}]]} != {'band_metadata': []}
  Left contains 2 more items:
  {'crs': 'http://www.opengis.net/def/crs/EPSG/0/4326', 'dimensions': ['y', 'x']}
  
  Full diff:
    {
        'attrs': {},
  -     'band_descriptions': [],
  ?                           --
  +     'band_descriptions': [
  +         [
  +             'b1',
  +             '0',
  +         ],
  +     ],
  -     'band_metadata': [],
  ?                       --
  +     'band_metadata': [
  +         [
  +             'b1',
  +             {},
  +         ],
  +     ],
        'bounds': [
  -         -180,
  +         -180.0,
  ?             ++
            -90.0,
            180.0,
            90.0,
        ],
        'count': 1,
  +     'crs': 'http://www.opengis.net/def/crs/EPSG/0/4326',
  +     'dimensions': [
  +         'y',
  +         'x',
  +     ],
        'dtype': 'float64',
        'height': 36,
        'name': 'CDD0',
  -     'nodata_type': 'None',
  ?                       ^^
  +     'nodata_type': 'Nodata',
  ?                       ^^^^
        'width': 72,
    }

I am not exactly sure how these come about TBH.

Are 'band_metadata', nodata_type, dimensions... changes that have been made to main recently? Or is this something that comes from xarray?

Happy to just rewrite the expected output, but I first wanted to understand exactly what is going on.

All I could gather here was that these response fields are expected for e.g. the netcdf output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant