|
4 | 4 |
|
5 | 5 | import parcels._interpolation as interpolation |
6 | 6 | from parcels import AdvectionRK4_3D, FieldSet, JITParticle, ParticleSet, ScipyParticle |
7 | | -from tests.utils import create_fieldset_zeros_3d |
| 7 | +from tests.utils import TEST_DATA, create_fieldset_zeros_3d |
8 | 8 |
|
9 | 9 |
|
10 | 10 | @pytest.fixture |
@@ -52,6 +52,7 @@ def create_interpolation_data(): |
52 | 52 |
|
53 | 53 | def create_interpolation_data_random(*, with_land_point: bool) -> xr.Dataset: |
54 | 54 | tdim, zdim, ydim, xdim = 20, 5, 10, 10 |
| 55 | + np.random.seed(1636) |
55 | 56 | ds = xr.Dataset( |
56 | 57 | { |
57 | 58 | "U": (("time", "depth", "lat", "lon"), (np.random.random((tdim, zdim, ydim, xdim)) / 1e2)), |
@@ -145,8 +146,10 @@ def test_scipy_vs_jit(interp_method): |
145 | 146 | """Test that the scipy and JIT versions of the interpolation are the same.""" |
146 | 147 | variables = {"U": "U", "V": "V", "W": "W"} |
147 | 148 | dimensions = {"time": "time", "lon": "lon", "lat": "lat", "depth": "depth"} |
| 149 | + ds = create_interpolation_data_random(with_land_point=interp_method == "freeslip") |
| 150 | + ds.to_netcdf(str(TEST_DATA / f"test_interpolation_data_random_{interp_method}.nc")) |
148 | 151 | fieldset = FieldSet.from_xarray_dataset( |
149 | | - create_interpolation_data_random(with_land_point=interp_method == "freeslip"), |
| 152 | + ds, |
150 | 153 | variables, |
151 | 154 | dimensions, |
152 | 155 | mesh="flat", |
|
0 commit comments