-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
added netCDF4 requirement to failing tests #5564
Conversation
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 =========================== |
Good catch, @joeperdefloep, this should be fixed by decorating the test with |
Unit Test Results 6 files 6 suites 52m 19s ⏱️ Results for commit fab8263. ♻️ This comment has been updated with latest results. |
Looks great. Thanks @joeperdefloep . I see this is your first contribution to xarray. Welcome! |
pre-commit run --all-files
whats-new.rst
api.rst