diff --git a/pyproject.toml b/pyproject.toml index fc73eb3a..1cfabb12 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,7 @@ dependencies = [ "natsort>=5.5.0", "matplotlib>=3.1.1,!=3.3.0,!=3.3.1,!=3.3.2", "animatplot-ng>=0.4.2", - "netcdf4>=1.4.0", + "h5netcdf", "Pillow>=6.1.0", ] diff --git a/requirements.txt b/requirements.txt index 1f8dbfff..73d9aefe 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ dask[array]>=2.10.0 natsort>=5.5.0 matplotlib>=3.1.1,!=3.3.0,!=3.3.1,!=3.3.2 animatplot>=0.4.2 -netcdf4>=1.4.0 +h5netcdf Pillow>=6.1.0 # Not required for Python>=3.8, but included because conda does not support diff --git a/xbout/tests/conftest.py b/xbout/tests/conftest.py index 99b3b016..1867f312 100644 --- a/xbout/tests/conftest.py +++ b/xbout/tests/conftest.py @@ -165,7 +165,7 @@ def create_example_grid_file_fci(tmp_path_factory): # Save filepath = save_dir.joinpath("fci.nc") - grid.to_netcdf(filepath, engine="netcdf4") + grid.to_netcdf(filepath, engine="h5netcdf") return filepath diff --git a/xbout/tests/test_grid.py b/xbout/tests/test_grid.py index 007733b4..87ff4a98 100644 --- a/xbout/tests/test_grid.py +++ b/xbout/tests/test_grid.py @@ -27,7 +27,7 @@ def create_example_grid_file(tmp_path_factory): # Save filepath = save_dir.joinpath("grid.nc") - grid.to_netcdf(filepath, engine="netcdf4") + grid.to_netcdf(filepath, engine="h5netcdf") return filepath @@ -52,7 +52,7 @@ def test_open_grid_extra_dims(self, create_example_grid_file, tmp_path_factory): dodgy_grid_directory = tmp_path_factory.mktemp("dodgy_grid") dodgy_grid_path = dodgy_grid_directory.joinpath("dodgy_grid.nc") - merge([example_grid, new_var]).to_netcdf(dodgy_grid_path, engine="netcdf4") + merge([example_grid, new_var]).to_netcdf(dodgy_grid_path, engine="h5netcdf") with pytest.warns( UserWarning, match="drop all variables containing " "the dimensions 'w'" diff --git a/xbout/tests/test_load.py b/xbout/tests/test_load.py index 20ddcae0..6b7ad323 100644 --- a/xbout/tests/test_load.py +++ b/xbout/tests/test_load.py @@ -43,7 +43,7 @@ def test_check_extensions(tmp_path): example_nc_file.write_text("content_nc") filetype = _check_filetype(example_nc_file) - assert filetype == "netcdf4" + assert filetype == "h5netcdf" example_hdf5_file = files_dir.joinpath("example.h5netcdf") example_hdf5_file.write_text("content_hdf5") diff --git a/xbout/utils.py b/xbout/utils.py index 66e6439d..b4a00f31 100644 --- a/xbout/utils.py +++ b/xbout/utils.py @@ -31,7 +31,7 @@ def _add_attrs_to_var(ds, varname, copy=False): def _check_filetype(path): if path.suffix == ".nc": - filetype = "netcdf4" + filetype = "h5netcdf" elif path.suffix == ".h5netcdf": filetype = "h5netcdf" elif path.suffix == ".bp": diff --git a/xbout/xarraybackend.py b/xbout/xarraybackend.py index 38f4d65c..6a9644c5 100644 --- a/xbout/xarraybackend.py +++ b/xbout/xarraybackend.py @@ -1,6 +1,6 @@ """License: - Distributed under the OSI-approved Apache License, Version 2.0. See - accompanying file Copyright.txt for details. +Distributed under the OSI-approved Apache License, Version 2.0. See +accompanying file Copyright.txt for details. """ from __future__ import annotations