Skip to content
Merged
18 changes: 10 additions & 8 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,23 @@ 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
sudo apt-get -y install libhdf5-dev
- name: Install package
run: |
pip install -e .[calc,tests]
pip install -e .[calc,tests] --no-binary h5netcdf --no-binary h5py
pip install git+https://github.com/dschwoerer/xarray@netcdf4-locking-closing
- name: Test with pytest
run: |
pytest -vv --long --cov
Expand All @@ -48,7 +49,7 @@ jobs:
if: always()
strategy:
matrix:
python-version: ["3.8"]
python-version: ["3.12"]
fail-fast: false

steps:
Expand All @@ -59,12 +60,13 @@ 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
sudo apt-get -y install libhdf5-dev
pip install xarray~=2023.12.0 pandas~=2.2.0
- name: Install package
run: |
pip install -e .[tests]
pip install -e .[tests] --no-binary h5netcdf --no-binary h5py
pip install git+https://github.com/dschwoerer/xarray@netcdf4-locking-closing
- name: Test with pytest
run: |
pytest -vv --long --cov
16 changes: 10 additions & 6 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,23 @@ 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:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
sudo apt-get -y install libhdf5-dev
- name: Install package
run: |
pip install -e .[calc,tests]
pip install -e .[calc,tests] --no-binary h5netcdf --no-binary h5py
pip install git+https://github.com/dschwoerer/xarray@netcdf4-locking-closing
- name: Test with pytest
run: |
pytest -vv --long --cov
Expand All @@ -47,7 +49,7 @@ jobs:
if: always()
strategy:
matrix:
python-version: ["3.8"]
python-version: ["3.12"]
fail-fast: false

steps:
Expand All @@ -59,10 +61,12 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install xarray~=2023.1.0 pandas~=1.4.0
sudo apt-get -y install libhdf5-dev
pip install xarray~=2023.12.0 pandas~=2.2.0
- name: Install package
run: |
pip install -e .[tests]
pip install -e .[tests] --no-binary h5netcdf --no-binary h5py
pip install git+https://github.com/dschwoerer/xarray@netcdf4-locking-closing
- name: Test with pytest
run: |
pytest -vv --long --cov
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion xbout/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions xbout/tests/test_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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'"
Expand Down
2 changes: 1 addition & 1 deletion xbout/tests/test_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion xbout/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down