added netCDF4 requirement to failing tests - #5564
Merged
Merged
Conversation
Contributor
Author
|
Also there is an issue when: cd xarray
pip install -e .
pip install h5netcdf pytest-xdist netcdf4
py.test -n 2 xarray/tests/test_backends.py======================================================== FAILURES =========================================================
________________________________________ TestH5NetCDFFileObject.test_open_fileobj _________________________________________
[gw2] linux -- Python 3.9.5 /home/joeperdefloep/miniconda3/envs/xr-dev/bin/python3.9
self = <xarray.tests.test_backends.TestH5NetCDFFileObject object at 0x7f7e841a4220>
def test_open_fileobj(self):
# open in-memory datasets instead of local file paths
expected = create_test_data().drop_vars("dim3")
expected.attrs["foo"] = "bar"
with create_tmp_file() as tmp_file:
expected.to_netcdf(tmp_file, engine="h5netcdf")
with open(tmp_file, "rb") as f:
with open_dataset(f, engine="h5netcdf") as actual:
assert_identical(expected, actual)
f.seek(0)
with open_dataset(f) as actual:
assert_identical(expected, actual)
f.seek(0)
with BytesIO(f.read()) as bio:
with open_dataset(bio, engine="h5netcdf") as actual:
assert_identical(expected, actual)
f.seek(0)
with pytest.raises(TypeError, match="not a valid NetCDF 3"):
> open_dataset(f, engine="scipy")
/mnt/e/Git/xarray/xarray/tests/test_backends.py:2887:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/mnt/e/Git/xarray/xarray/backends/api.py:483: in open_dataset
backend = plugins.get_backend(engine)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
engine = 'scipy'
def get_backend(engine):
"""Select open_dataset method based on current engine."""
if isinstance(engine, str):
engines = list_engines()
if engine not in engines:
> raise ValueError(
f"unrecognized engine {engine} must be one of: {list(engines)}"
)
E ValueError: unrecognized engine scipy must be one of: ['netcdf4', 'h5netcdf', 'store']
/mnt/e/Git/xarray/xarray/backends/plugins.py:156: ValueError
================================================= short test summary info =================================================
FAILED xarray/tests/test_backends.py::TestH5NetCDFFileObject::test_open_fileobj - ValueError: unrecognized engine scipy ...
=========================== 1 failed, 458 passed, 818 skipped, 18 xfailed, 6 xpassed in 25.08s =========================== |
Collaborator
|
Good catch, @joeperdefloep, this should be fixed by decorating the test with |
Contributor
Unit Test Results 6 files 6 suites 52m 19s ⏱️ Results for commit fab8263. ♻️ This comment has been updated with latest results. |
Contributor
|
Looks great. Thanks @joeperdefloep . I see this is your first contribution to xarray. Welcome! |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pre-commit run --all-fileswhats-new.rstapi.rst