@@ -30,14 +30,14 @@ def fieldset() -> FieldSet: # TODO v4: Move into a `conftest.py` file and remov
3030 )
3131
3232
33- @pytest .mark .skip
3433def test_metadata (fieldset , tmp_zarrfile ):
3534 pset = ParticleSet (fieldset , pclass = Particle , lon = 0 , lat = 0 )
3635
37- pset .execute (DoNothing , runtime = 1 , output_file = ParticleFile (tmp_zarrfile , outputdt = np .timedelta64 (1 , "s" )))
36+ ofile = ParticleFile (tmp_zarrfile , outputdt = np .timedelta64 (1 , "s" ))
37+ pset .execute (DoNothing , runtime = np .timedelta64 (1 , "s" ), dt = np .timedelta64 (1 , "s" ), output_file = ofile )
3838
39- ds = xr .open_zarr (tmp_zarrfile , decode_cf = False ) # TODO v4: Fix metadata and re-enable decode_cf
40- assert ds .attrs ["parcels_kernels" ].lower () == "ParticleDoNothing " .lower ()
39+ ds = xr .open_zarr (tmp_zarrfile )
40+ assert ds .attrs ["parcels_kernels" ].lower () == "DoNothing " .lower ()
4141
4242
4343def test_pfile_array_write_zarr_memorystore (fieldset ):
@@ -76,11 +76,8 @@ def test_pfile_array_remove_particles(fieldset, tmp_zarrfile):
7676 pset ._data ["time" ][:] = new_time
7777 pset ._data ["time_nextloop" ][:] = new_time
7878 pfile .write (pset , new_time )
79- ds = xr .open_zarr (tmp_zarrfile , decode_cf = False )
79+ ds = xr .open_zarr (tmp_zarrfile )
8080 timearr = ds ["time" ][:]
81- pytest .skip (
82- "TODO v4: Set decode_cf=True, which will mean that missing values get decoded to NaT rather than fill value"
83- )
8481 assert (np .isnat (timearr [3 , 1 ])) and (np .isfinite (timearr [3 , 0 ]))
8582
8683
@@ -129,7 +126,7 @@ def Update_lon(particles, fieldset): # pragma: no cover
129126 output_file = ofile ,
130127 )
131128
132- ds = xr .open_zarr (tmp_zarrfile , decode_cf = False ) # TODO v4: Fix metadata and re-enable decode_cf
129+ ds = xr .open_zarr (tmp_zarrfile )
133130 lons = ds ["lon" ][:]
134131 assert isinstance (lons .values [0 , 0 ], np .float64 )
135132
0 commit comments