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

fix test with pseudonetcdf 3.2 #5875

Merged
merged 1 commit into from
Oct 22, 2021

Conversation

mathause
Copy link
Collaborator

@mathause mathause commented Oct 18, 2021

Fixes one part of #5872

pseudoNETCDF adds two attrs to ict files, which breaks the following two tests:

Test 1:

def test_ict_format(self):

Test 2:

def test_ict_format_write(self):

I reproduced the test file so that the tests pass again. To reproduce the file I used the following bit of code:

import xarray as xr
from xarray.tests import test_backends

fN = "xarray/tests/data/example.ict"
fmtkw = {"format": "ffi1001"}

ds = xr.open_dataset(fN, engine="pseudonetcdf", backend_kwargs={"format": "ffi1001"})

c = test_backends.TestPseudoNetCDFFormat()
c.save(ds, fN, **fmtkw)

The save method is here:

def save(self, dataset, path, **save_kwargs):

@barronh I would appreciate your review here - I am not sure if this is the right approach.

@github-actions
Copy link
Contributor

Unit Test Results

         6 files           6 suites   53m 22s ⏱️
16 230 tests 14 494 ✔️ 1 736 💤 0
90 576 runs  82 396 ✔️ 8 180 💤 0

Results for commit d72c3be.

@barronh
Copy link
Contributor

barronh commented Oct 18, 2021

This makes sense to me. These attributes more fully describe the independent variable. They were added due to a lack of clarity and to allow better unit handling on the independent variable. Thank you for updating the test.

@mathause
Copy link
Collaborator Author

Thanks for the feedback - so I suggest to merge soonish as this breaks the tests on main.

@Illviljan
Copy link
Contributor

Looks good to me. Shall we merge?

@mathause mathause merged commit 29e38db into pydata:main Oct 22, 2021
@mathause mathause deleted the fix_test_pseudonetcdf_32 branch October 22, 2021 21:23
@mathause
Copy link
Collaborator Author

Jup, let's merge. Thanks!

dcherian added a commit to dcherian/xarray that referenced this pull request Oct 23, 2021
* upstream/main:
  fix test with pseudonetcdf 3.2 (pydata#5875)
snowman2 pushed a commit to snowman2/xarray that referenced this pull request Feb 9, 2022
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.

3 participants