Skip to content

Commit b26e8d4

Browse files
committed
Update test_convert_fesom_to_ugrid to use remote dataset
1 parent 264a9f5 commit b26e8d4

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

src/parcels/_datasets/remote.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,11 @@
102102
+ [f"data/WOA_data/woa18_decav_t{m:02d}_04.nc" for m in range(1, 13)]
103103
+ ["data/CROCOidealized_data/CROCO_idealized.nc"]
104104
# These datasets are from v4 of Parcels where we're opting for Zipped zarr datasets
105-
# ...
105+
+ [
106+
"data-zarr/Benchmarks_FESOM2-baroclinic-gyre/data.zip",
107+
"data-zarr/Benchmarks_FESOM2-baroclinic-gyre/grid.zip",
108+
]
109+
+ []
106110
)
107111

108112
_ODIE = pooch.create(
@@ -217,6 +221,9 @@ class _Purpose(enum.Enum):
217221
("SWASH_data/data", (_V3Dataset(_ODIE,"data/SWASH_data/field_00655*.nc"), _Purpose.TUTORIAL)),
218222
("WOA_data/data", (_V3Dataset(_ODIE,"data/WOA_data/woa18_decav_t*_04.nc", _preprocess_set_cf_calendar_360_day), _Purpose.TUTORIAL)),
219223
("CROCOidealized_data/data", (_V3Dataset(_ODIE,"data/CROCOidealized_data/CROCO_idealized.nc"), _Purpose.TUTORIAL)),
224+
] + [
225+
("Benchmarks_FESOM2-baroclinic-gyre/data", (_ZarrZipDataset(_ODIE, 'data-zarr/Benchmarks_FESOM2-baroclinic-gyre/data.zip'), _Purpose.TESTING)),
226+
("Benchmarks_FESOM2-baroclinic-gyre/grid", (_ZarrZipDataset(_ODIE, 'data-zarr/Benchmarks_FESOM2-baroclinic-gyre/grid.zip'),_Purpose.TESTING)),
220227
])
221228
# fmt: on
222229

tests/test_convert.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import parcels.tutorial
88
from parcels import FieldSet
99
from parcels._core.utils import sgrid
10+
from parcels._datasets.remote import open_remote_dataset
1011
from parcels._datasets.structured.circulation_models import datasets as datasets_circulation_models
1112
from parcels.interpolators._xinterpolators import _get_offsets_dictionary
1213

@@ -126,13 +127,8 @@ def test_convert_copernicusmarine_no_logs(ds, caplog):
126127

127128

128129
def test_convert_fesom_to_ugrid():
129-
PARCELS_BENCHMARKS_DATA_FOLDER = "../parcels-benchmarks/data"
130-
grid_file = xr.open_mfdataset(
131-
f"{PARCELS_BENCHMARKS_DATA_FOLDER}/surf-data/parcels-benchmarks/data/Parcelsv4_Benchmarking_data/Parcels_Benchmarks_FESOM-baroclinic-gyre/data/mesh/fesom.mesh.diag.nc"
132-
)
133-
data_files = xr.open_mfdataset(
134-
f"{PARCELS_BENCHMARKS_DATA_FOLDER}/surf-data/parcels-benchmarks/data/Parcelsv4_Benchmarking_data/Parcels_Benchmarks_FESOM-baroclinic-gyre/data/*.nc"
135-
)
130+
grid_file = open_remote_dataset("Benchmarks_FESOM2-baroclinic-gyre/grid")
131+
data_files = open_remote_dataset("Benchmarks_FESOM2-baroclinic-gyre/data")
136132

137133
grid = ux.open_grid(grid_file)
138134
uxds = ux.UxDataset(data_files, uxgrid=grid)

0 commit comments

Comments
 (0)