Skip to content

Commit d348e03

Browse files
committed
Switch to h5netcdf as default engine
This works around pydata/xarray#9779
1 parent cb87f23 commit d348e03

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ dependencies = [
4040
"natsort>=5.5.0",
4141
"matplotlib>=3.1.1,!=3.3.0,!=3.3.1,!=3.3.2",
4242
"animatplot-ng>=0.4.2",
43-
"netcdf4>=1.4.0",
43+
"h5netcdf",
4444
"Pillow>=6.1.0",
4545
]
4646

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ dask[array]>=2.10.0
44
natsort>=5.5.0
55
matplotlib>=3.1.1,!=3.3.0,!=3.3.1,!=3.3.2
66
animatplot>=0.4.2
7-
netcdf4>=1.4.0
7+
h5netcdf
88
Pillow>=6.1.0
99

1010
# Not required for Python>=3.8, but included because conda does not support

xbout/tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def create_example_grid_file_fci(tmp_path_factory):
165165

166166
# Save
167167
filepath = save_dir.joinpath("fci.nc")
168-
grid.to_netcdf(filepath, engine="netcdf4")
168+
grid.to_netcdf(filepath, engine="h5netcdf")
169169

170170
return filepath
171171

xbout/tests/test_grid.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def create_example_grid_file(tmp_path_factory):
2727

2828
# Save
2929
filepath = save_dir.joinpath("grid.nc")
30-
grid.to_netcdf(filepath, engine="netcdf4")
30+
grid.to_netcdf(filepath, engine="h5netcdf")
3131

3232
return filepath
3333

@@ -52,7 +52,7 @@ def test_open_grid_extra_dims(self, create_example_grid_file, tmp_path_factory):
5252

5353
dodgy_grid_directory = tmp_path_factory.mktemp("dodgy_grid")
5454
dodgy_grid_path = dodgy_grid_directory.joinpath("dodgy_grid.nc")
55-
merge([example_grid, new_var]).to_netcdf(dodgy_grid_path, engine="netcdf4")
55+
merge([example_grid, new_var]).to_netcdf(dodgy_grid_path, engine="h5netcdf")
5656

5757
with pytest.warns(
5858
UserWarning, match="drop all variables containing " "the dimensions 'w'"

xbout/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def _add_attrs_to_var(ds, varname, copy=False):
3131

3232
def _check_filetype(path):
3333
if path.suffix == ".nc":
34-
filetype = "netcdf4"
34+
filetype = "h5netcdf"
3535
elif path.suffix == ".h5netcdf":
3636
filetype = "h5netcdf"
3737
elif path.suffix == ".bp":

0 commit comments

Comments
 (0)