Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
pgierz committed Nov 15, 2024
1 parent cf03e14 commit 5e466a4
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions tests/meta/test_xarray_open_mfdataset.py
Original file line number Diff line number Diff line change
@@ -1,40 +1,54 @@
import pytest
import xarray as xr


def test_open_fesom_2p6_pimesh_esm_tools(fesom_2p6_pimesh_esm_tools_data):
@pytest.parametrize("engine", ["netcdf4", "h5netcdf"])
def test_open_fesom_2p6_pimesh_esm_tools(fesom_2p6_pimesh_esm_tools_data, engine):
ds = xr.open_mfdataset(
f
for f in (fesom_2p6_pimesh_esm_tools_data / "outdata/fesom/").iterdir()
if f.name.startswith("temp")
(
f
for f in (fesom_2p6_pimesh_esm_tools_data / "outdata/fesom/").iterdir()
if f.name.startswith("temp")
),
engine=engine,
)
assert isinstance(ds, xr.Dataset)


def test_open_fesom_2p6_pimesh_esm_tools_cftime(fesom_2p6_pimesh_esm_tools_data):
@pytest.parametrize("engine", ["netcdf4", "h5netcdf"])
def test_open_fesom_2p6_pimesh_esm_tools_cftime(
fesom_2p6_pimesh_esm_tools_data, engine
):
ds = xr.open_mfdataset(
(
f
for f in (fesom_2p6_pimesh_esm_tools_data / "outdata/fesom/").iterdir()
if f.name.startswith("temp")
),
use_cftime=True,
engine=engine,
)
assert isinstance(ds, xr.Dataset)


def test_open_fesom_2p6_pimesh_esm_tools_parallel(fesom_2p6_pimesh_esm_tools_data):
@pytest.parametrize("engine", ["netcdf4", "h5netcdf"])
def test_open_fesom_2p6_pimesh_esm_tools_parallel(
fesom_2p6_pimesh_esm_tools_data, engine
):
ds = xr.open_mfdataset(
(
f
for f in (fesom_2p6_pimesh_esm_tools_data / "outdata/fesom/").iterdir()
if f.name.startswith("temp")
),
parallel=True,
engine=engine,
)
assert isinstance(ds, xr.Dataset)


def test_open_fesom_2p6_pimesh_esm_tools_full(fesom_2p6_pimesh_esm_tools_data):
@pytest.parametrize("engine", ["netcdf4", "h5netcdf"])
def test_open_fesom_2p6_pimesh_esm_tools_full(fesom_2p6_pimesh_esm_tools_data, engine):
ds = xr.open_mfdataset(
(
f
Expand All @@ -43,5 +57,6 @@ def test_open_fesom_2p6_pimesh_esm_tools_full(fesom_2p6_pimesh_esm_tools_data):
),
use_cftime=True,
parallel=True,
engine=engine,
)
assert isinstance(ds, xr.Dataset)

0 comments on commit 5e466a4

Please sign in to comment.