Skip to content

Commit 4736038

Browse files
committed
Add xfail markers
1 parent 4bf5096 commit 4736038

6 files changed

Lines changed: 62 additions & 0 deletions

File tree

tests/test_advection.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def depth():
5858

5959

6060
@pytest.mark.v4alpha
61+
@pytest.mark.xfail(reason="GH1946")
6162
def test_advection_zonal(lon, lat, depth):
6263
"""Particles at high latitude move geographically faster due to the pole correction in `GeographicPolar`."""
6364
npart = 10
@@ -90,6 +91,7 @@ def test_advection_zonal(lon, lat, depth):
9091

9192

9293
@pytest.mark.v4alpha
94+
@pytest.mark.xfail(reason="GH1946")
9395
def test_advection_meridional(lon, lat):
9496
"""Particles at high latitude move geographically faster due to the pole correction in `GeographicPolar`."""
9597
npart = 10
@@ -104,6 +106,7 @@ def test_advection_meridional(lon, lat):
104106

105107

106108
@pytest.mark.v4alpha
109+
@pytest.mark.xfail(reason="GH1946")
107110
def test_advection_3D():
108111
"""Flat 2D zonal flow that increases linearly with depth from 0 m/s to 1 m/s."""
109112
xdim = ydim = zdim = 2
@@ -126,6 +129,7 @@ def test_advection_3D():
126129

127130

128131
@pytest.mark.v4alpha
132+
@pytest.mark.xfail(reason="GH1946")
129133
@pytest.mark.parametrize("direction", ["up", "down"])
130134
@pytest.mark.parametrize("wErrorThroughSurface", [True, False])
131135
def test_advection_3D_outofbounds(direction, wErrorThroughSurface):
@@ -172,6 +176,7 @@ def SubmergeParticle(particle, fieldset, time): # pragma: no cover
172176

173177

174178
@pytest.mark.v4alpha
179+
@pytest.mark.xfail(reason="GH1946")
175180
@pytest.mark.parametrize("rk45_tol", [10, 100])
176181
def test_advection_RK45(lon, lat, rk45_tol):
177182
npart = 10
@@ -330,6 +335,7 @@ def test_advection_periodic_zonal_meridional():
330335

331336

332337
@pytest.mark.v4alpha
338+
@pytest.mark.xfail(reason="GH1946")
333339
@pytest.mark.parametrize("u", [-0.3, np.array(0.2)])
334340
@pytest.mark.parametrize("v", [0.2, np.array(1)])
335341
@pytest.mark.parametrize("w", [None, -0.2, np.array(0.7)])
@@ -408,6 +414,7 @@ def fieldset_stationary():
408414

409415

410416
@pytest.mark.v4alpha
417+
@pytest.mark.xfail(reason="GH1946")
411418
@pytest.mark.parametrize(
412419
"method, rtol, diffField",
413420
[
@@ -443,6 +450,7 @@ def test_stationary_eddy(fieldset_stationary, method, rtol, diffField):
443450

444451

445452
@pytest.mark.v4alpha
453+
@pytest.mark.xfail(reason="GH1946")
446454
def test_stationary_eddy_vertical():
447455
npart = 1
448456
lon = np.linspace(12000, 21000, npart)
@@ -514,6 +522,7 @@ def fieldset_moving():
514522

515523

516524
@pytest.mark.v4alpha
525+
@pytest.mark.xfail(reason="GH1946")
517526
@pytest.mark.parametrize(
518527
"method, rtol, diffField",
519528
[
@@ -592,6 +601,7 @@ def fieldset_decaying():
592601

593602

594603
@pytest.mark.v4alpha
604+
@pytest.mark.xfail(reason="GH1946")
595605
@pytest.mark.parametrize(
596606
"method, rtol, diffField",
597607
[
@@ -633,6 +643,7 @@ def test_decaying_eddy(fieldset_decaying, method, rtol, diffField):
633643

634644

635645
@pytest.mark.v4alpha
646+
@pytest.mark.xfail(reason="GH1946")
636647
def test_analyticalAgrid():
637648
lon = np.arange(0, 15, dtype=np.float32)
638649
lat = np.arange(0, 15, dtype=np.float32)

tests/test_diffusion.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919

2020
@pytest.mark.v4alpha
21+
@pytest.mark.xfail(reason="GH1946")
2122
@pytest.mark.parametrize("mesh", ["spherical", "flat"])
2223
def test_fieldKh_Brownian(mesh):
2324
xdim = 200
@@ -52,6 +53,7 @@ def test_fieldKh_Brownian(mesh):
5253

5354

5455
@pytest.mark.v4alpha
56+
@pytest.mark.xfail(reason="GH1946")
5557
@pytest.mark.parametrize("mesh", ["spherical", "flat"])
5658
@pytest.mark.parametrize("kernel", [AdvectionDiffusionM1, AdvectionDiffusionEM])
5759
def test_fieldKh_SpatiallyVaryingDiffusion(mesh, kernel):
@@ -86,6 +88,7 @@ def test_fieldKh_SpatiallyVaryingDiffusion(mesh, kernel):
8688

8789

8890
@pytest.mark.v4alpha
91+
@pytest.mark.xfail(reason="GH1946")
8992
@pytest.mark.parametrize("lambd", [1, 5])
9093
def test_randomexponential(lambd):
9194
fieldset = create_fieldset_zeros_conversion()
@@ -113,6 +116,7 @@ def vertical_randomexponential(particle, fieldset, time): # pragma: no cover
113116

114117

115118
@pytest.mark.v4alpha
119+
@pytest.mark.xfail(reason="GH1946")
116120
@pytest.mark.parametrize("mu", [0.8 * np.pi, np.pi])
117121
@pytest.mark.parametrize("kappa", [2, 4])
118122
def test_randomvonmises(mu, kappa):

tests/test_field.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313

1414
@pytest.mark.v4alpha
15+
@pytest.mark.xfail(reason="GH1946")
1516
def test_field_from_netcdf_variables():
1617
filename = str(TEST_DATA / "perlinfieldsU.nc")
1718
dims = {"lon": "x", "lat": "y"}
@@ -32,6 +33,7 @@ def test_field_from_netcdf_variables():
3233

3334

3435
@pytest.mark.v4remove
36+
@pytest.mark.xfail(reason="GH1946")
3537
def test_field_from_netcdf():
3638
filenames = {
3739
"lon": str(TEST_DATA / "mask_nemo_cross_180lon.nc"),
@@ -44,6 +46,7 @@ def test_field_from_netcdf():
4446

4547

4648
@pytest.mark.v4remove
49+
@pytest.mark.xfail(reason="GH1946")
4750
@pytest.mark.parametrize(
4851
"calendar, cftime_datetime", zip(_get_cftime_calendars(), _get_cftime_datetimes(), strict=True)
4952
)

tests/test_fieldset.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ def to_xarray_dataset(data: dict[str, np.array], dimensions: dict[str, np.array]
5656

5757

5858
@pytest.mark.v4remove
59+
@pytest.mark.xfail(reason="GH1946")
5960
@pytest.fixture
6061
def multifile_fieldset(tmp_path):
6162
stem = "test_subsets"
@@ -79,6 +80,7 @@ def multifile_fieldset(tmp_path):
7980

8081

8182
@pytest.mark.v4alpha
83+
@pytest.mark.xfail(reason="GH1946")
8284
@pytest.mark.parametrize("xdim", [100, 200])
8385
@pytest.mark.parametrize("ydim", [100, 200])
8486
def test_fieldset_from_data(xdim, ydim):
@@ -101,6 +103,7 @@ def test_fieldset_vmin_vmax():
101103

102104

103105
@pytest.mark.v4alpha
106+
@pytest.mark.xfail(reason="GH1946")
104107
@pytest.mark.parametrize("ttype", ["float", "datetime64"])
105108
@pytest.mark.parametrize("tdim", [1, 20])
106109
def test_fieldset_from_data_timedims(ttype, tdim):
@@ -116,6 +119,7 @@ def test_fieldset_from_data_timedims(ttype, tdim):
116119

117120

118121
@pytest.mark.v4alpha
122+
@pytest.mark.xfail(reason="GH1946")
119123
@pytest.mark.parametrize("xdim", [100, 200])
120124
@pytest.mark.parametrize("ydim", [100, 50])
121125
def test_fieldset_from_data_different_dimensions(xdim, ydim):
@@ -146,6 +150,7 @@ def test_fieldset_from_data_different_dimensions(xdim, ydim):
146150

147151

148152
@pytest.mark.v4alpha
153+
@pytest.mark.xfail(reason="GH1946")
149154
def test_fieldset_from_modulefile():
150155
nemo_fname = str(TEST_DATA / "fieldset_nemo.py")
151156
nemo_error_fname = str(TEST_DATA / "fieldset_nemo_error.py")
@@ -165,6 +170,7 @@ def test_fieldset_from_modulefile():
165170

166171

167172
@pytest.mark.v4alpha
173+
@pytest.mark.xfail(reason="GH1946")
168174
def test_field_from_netcdf_fieldtypes():
169175
filenames = {
170176
"varU": {
@@ -191,6 +197,7 @@ def test_field_from_netcdf_fieldtypes():
191197

192198

193199
@pytest.mark.v4alpha
200+
@pytest.mark.xfail(reason="GH1946")
194201
def test_fieldset_from_agrid_dataset():
195202
filenames = {
196203
"lon": str(TEST_DATA / "mask_nemo_cross_180lon.nc"),
@@ -203,6 +210,7 @@ def test_fieldset_from_agrid_dataset():
203210

204211

205212
@pytest.mark.v4remove
213+
@pytest.mark.xfail(reason="GH1946")
206214
def test_fieldset_from_cgrid_interpmethod():
207215
filenames = {
208216
"lon": str(TEST_DATA / "mask_nemo_cross_180lon.nc"),
@@ -218,6 +226,7 @@ def test_fieldset_from_cgrid_interpmethod():
218226

219227

220228
@pytest.mark.v4alpha
229+
@pytest.mark.xfail(reason="GH1946")
221230
@pytest.mark.parametrize("calltype", ["from_data", "from_nemo"])
222231
def test_illegal_dimensionsdict(calltype):
223232
with pytest.raises(NameError):
@@ -234,6 +243,7 @@ def test_illegal_dimensionsdict(calltype):
234243

235244

236245
@pytest.mark.v4alpha
246+
@pytest.mark.xfail(reason="GH1946")
237247
@pytest.mark.parametrize("xdim", [100, 200])
238248
@pytest.mark.parametrize("ydim", [100, 200])
239249
def test_add_field(xdim, ydim, tmpdir):
@@ -245,6 +255,7 @@ def test_add_field(xdim, ydim, tmpdir):
245255

246256

247257
@pytest.mark.v4alpha
258+
@pytest.mark.xfail(reason="GH1946")
248259
@pytest.mark.parametrize("dupobject", ["same", "new"])
249260
def test_add_duplicate_field(dupobject):
250261
data, dimensions = generate_fieldset_data(100, 100)
@@ -260,6 +271,7 @@ def test_add_duplicate_field(dupobject):
260271

261272

262273
@pytest.mark.v4alpha
274+
@pytest.mark.xfail(reason="GH1946")
263275
@pytest.mark.parametrize("fieldtype", ["normal", "vector"])
264276
def test_add_field_after_pset(fieldtype):
265277
data, dimensions = generate_fieldset_data(100, 100)
@@ -282,6 +294,7 @@ def test_fieldset_samegrids_from_file(multifile_fieldset):
282294

283295

284296
@pytest.mark.v4alpha
297+
@pytest.mark.xfail(reason="GH1946")
285298
@pytest.mark.parametrize("gridtype", ["A", "C"])
286299
def test_fieldset_dimlength1_cgrid(gridtype):
287300
fieldset = FieldSet.from_data({"U": 0, "V": 0}, {"lon": 0, "lat": 0})
@@ -304,6 +317,7 @@ def assign_dataset_timestamp_dim(ds, timestamp):
304317

305318

306319
@pytest.mark.v4remove
320+
@pytest.mark.xfail(reason="GH1946")
307321
def test_fieldset_diffgrids_from_file(tmp_path):
308322
"""Test for subsetting fieldset from file using indices dict."""
309323
stem = "test_subsets"
@@ -335,6 +349,7 @@ def test_fieldset_diffgrids_from_file(tmp_path):
335349

336350

337351
@pytest.mark.v4alpha
352+
@pytest.mark.xfail(reason="GH1946")
338353
def test_fieldset_diffgrids_from_file_data(multifile_fieldset):
339354
"""Test for subsetting fieldset from file using indices dict."""
340355
data, dimensions = generate_fieldset_data(100, 100)
@@ -349,6 +364,7 @@ def test_fieldset_diffgrids_from_file_data(multifile_fieldset):
349364

350365

351366
@pytest.mark.v4alpha
367+
@pytest.mark.xfail(reason="GH1946")
352368
def test_fieldset_samegrids_from_data():
353369
"""Test for subsetting fieldset from file using indices dict."""
354370
data, dimensions = generate_fieldset_data(100, 100)
@@ -365,6 +381,7 @@ def addConst(particle, fieldset, time): # pragma: no cover
365381

366382

367383
@pytest.mark.v4alpha
384+
@pytest.mark.xfail(reason="GH1946")
368385
def test_fieldset_constant():
369386
data, dimensions = generate_fieldset_data(100, 100)
370387
fieldset = FieldSet.from_data(data, dimensions)
@@ -380,6 +397,7 @@ def test_fieldset_constant():
380397

381398

382399
@pytest.mark.v4alpha
400+
@pytest.mark.xfail(reason="GH1946")
383401
@pytest.mark.parametrize("swapUV", [False, True])
384402
def test_vector_fields(swapUV):
385403
lon = np.linspace(0.0, 10.0, 12, dtype=np.float32)
@@ -404,6 +422,7 @@ def test_vector_fields(swapUV):
404422

405423

406424
@pytest.mark.v4alpha
425+
@pytest.mark.xfail(reason="GH1946")
407426
def test_add_second_vector_field():
408427
lon = np.linspace(0.0, 10.0, 12, dtype=np.float32)
409428
lat = np.linspace(0.0, 10.0, 10, dtype=np.float32)
@@ -556,6 +575,7 @@ def sampleTemp(particle, fieldset, time): # pragma: no cover
556575

557576

558577
@pytest.mark.v4alpha
578+
@pytest.mark.xfail(reason="GH1946")
559579
@pytest.mark.parametrize("tdim", [10, None])
560580
def test_fieldset_from_xarray(tdim):
561581
def generate_dataset(xdim, ydim, zdim=1, tdim=1):
@@ -611,6 +631,7 @@ def test_fieldset_frompop():
611631

612632

613633
@pytest.mark.v4alpha
634+
@pytest.mark.xfail(reason="GH1946")
614635
def test_fieldset_from_data_gridtypes():
615636
"""Simple test for fieldset initialisation from data."""
616637
xdim, ydim, zdim = 20, 10, 4

0 commit comments

Comments
 (0)