diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 4da18ff8..a42ae96a 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -20,22 +20,22 @@ jobs: if: always() strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.12", "3.13", "3.14", "3.x"] fail-fast: false steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - sudo apt-get update && sudo apt-get install libhdf5-dev libnetcdf-dev python -m pip install --upgrade pip - name: Install package run: | pip install -e .[calc,tests] + pip install git+https://github.com/dschwoerer/xarray@netcdf4-locking-closing - name: Test with pytest run: | pytest -vv --long --cov @@ -48,7 +48,7 @@ jobs: if: always() strategy: matrix: - python-version: ["3.8"] + python-version: ["3.12"] fail-fast: false steps: @@ -59,12 +59,12 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - sudo apt-get update && sudo apt-get install libhdf5-dev libnetcdf-dev python -m pip install --upgrade pip - pip install xarray~=2023.1.0 pandas~=1.4.0 + pip install xarray~=2023.12.0 pandas~=2.2.0 - name: Install package run: | pip install -e .[tests] + pip install git+https://github.com/dschwoerer/xarray@netcdf4-locking-closing - name: Test with pytest run: | pytest -vv --long --cov diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 823eafcf..26a4ccc1 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -20,11 +20,11 @@ jobs: if: always() strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.x"] + python-version: ["3.12", "3.13", "3.14", "3.x"] fail-fast: false steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: @@ -35,6 +35,7 @@ jobs: - name: Install package run: | pip install -e .[calc,tests] + pip install git+https://github.com/dschwoerer/xarray@netcdf4-locking-closing - name: Test with pytest run: | pytest -vv --long --cov @@ -47,7 +48,7 @@ jobs: if: always() strategy: matrix: - python-version: ["3.8"] + python-version: ["3.12"] fail-fast: false steps: @@ -59,10 +60,11 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install xarray~=2023.1.0 pandas~=1.4.0 + pip install xarray~=2023.12.0 pandas~=2.2.0 - name: Install package run: | pip install -e .[tests] + pip install git+https://github.com/dschwoerer/xarray@netcdf4-locking-closing - name: Test with pytest run: | pytest -vv --long --cov 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":