Skip to content
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

Testing time decoding #10

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Testing time decoding #10

wants to merge 6 commits into from

Conversation

jbusecke
Copy link
Owner

@jbusecke jbusecke commented Jun 11, 2024

I am testing zarr-developers/VirtualiZarr#122 on my CMIP example.

As part of this CI, I have set up a pytest module to create and test virtual datasets.

My current test for decoded time does indicate the the data seems to be decoded, but there are different attributes compared to a dataset that was loaded straight from http and then concatenated.

>       xr.testing.assert_identical(clean_time(ds), clean_time(ds_combined))
E       AssertionError: Left and right DataArray objects are not identical
E
E       Differing coordinates:
E       L * time     (time) datetime64[ns] 960B 2015-01-16T12:00:00 ... 2024-12-16T12...
E           Differing variable attributes:
E               chunksizes: [1]
E               fletcher32: False
E               shuffle: False
E               preferred_chunks: {'time': 1}
E               source: <File-like object HTTPFileSystem, http://aims3.llnl.gov/thredds/f...
E               original_shape: [60]
E               dtype: float64
E       R * time     (time) datetime64[ns] 960B 2015-01-16T12:00:00 ... 2024-12-16T12...
E       Attributes only on the left object:
E           original_shape: [60]
E           chunksizes: [1]
E           fletcher32: False
E           source: <File-like object HTTPFileSystem, http://aims3.llnl.gov/thredds/f...
E           shuffle: False
E           preferred_chunks: {'time': 1}
E           dtype: float64

tests/test_script.py:76: AssertionError

L in this case is the dataset loaded from the virtualizarr json, R is the 'ground truth'

I wonder if this is relevant or not in this usecase?

@jsignell
Copy link

Yeah so if I have my left and right correct it looks like there are some extra attributes that are sneaking in when using virtualizarr as compared to ground truth. I think those are xarray defaults that get added on load and if you had any of those attrs defined on the original they would be preserved. It would be good to test that though.

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.

2 participants