diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe3556bd99..2ee3aaec61 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,8 +81,9 @@ jobs: # TODO v4: Re-enable `tutorial_particle_field_interaction` # TODO v4: Re-enable `tutorial_croco_3D` # TODO v4: Re-enable `tutorial_nemo_3D` (https://github.com/OceanParcels/Parcels/pull/1936#issuecomment-2717666705) + # TODO v4: Re-enable `tutorial_analyticaladvection` run: | - coverage run -m pytest -v -s --nbval-lax -k "not documentation and not tutorial_periodic_boundaries and not tutorial_timevaryingdepthdimensions and not tutorial_particle_field_interaction and not tutorial_croco_3D and not tutorial_nemo_3D" --html="${{ matrix.os }}_${{ matrix.python-version }}_integration_test_report.html" --self-contained-html docs/examples + coverage run -m pytest -v -s --nbval-lax -k "not documentation and not tutorial_periodic_boundaries and not tutorial_timevaryingdepthdimensions and not tutorial_particle_field_interaction and not tutorial_croco_3D and not tutorial_nemo_3D and not tutorial_analyticaladvection" --html="${{ matrix.os }}_${{ matrix.python-version }}_integration_test_report.html" --self-contained-html docs/examples coverage xml - name: Codecov uses: codecov/codecov-action@v5.3.1 diff --git a/parcels/kernel.py b/parcels/kernel.py index ebbd00a464..716769e877 100644 --- a/parcels/kernel.py +++ b/parcels/kernel.py @@ -208,8 +208,6 @@ def check_fieldsets_in_kernels(self, pyfunc): # TODO v4: this can go into anoth """ if self.fieldset is not None: if pyfunc is AdvectionAnalytical: - if self.fieldset.particlefile is not None: - self.fieldset.particlefile._is_analytical = True if self._fieldset.U.interp_method != "cgrid_velocity": raise NotImplementedError("Analytical Advection only works with C-grids") if self._fieldset.U.grid._gtype not in [GridType.CurvilinearZGrid, GridType.RectilinearZGrid]: diff --git a/parcels/particlefile.py b/parcels/particlefile.py index 752e8b8ee0..7926caef93 100644 --- a/parcels/particlefile.py +++ b/parcels/particlefile.py @@ -64,7 +64,6 @@ def __init__(self, name, particleset, outputdt, chunks=None, create_new_zarrfile self.vars_to_write[var.name] = var.dtype self._mpi_rank = MPI.COMM_WORLD.Get_rank() if MPI else 0 self.particleset.fieldset._particlefile = self - self._is_analytical = False # Flag to indicate if ParticleFile is used for analytical trajectories # Reset obs_written of each particle, in case new ParticleFile created for a ParticleSet particleset.particledata.setallvardata("obs_written", 0) diff --git a/parcels/particleset.py b/parcels/particleset.py index b18ba02677..ec452f858b 100644 --- a/parcels/particleset.py +++ b/parcels/particleset.py @@ -1078,10 +1078,7 @@ def execute( if abs(time - next_output) < tol: if output_file: - if output_file._is_analytical: # output analytical solution at later time - output_file.write_latest_locations(self, time) - else: - output_file.write(self, time_at_startofloop) + output_file.write(self, time_at_startofloop) if np.isfinite(outputdt): next_output += outputdt * np.sign(dt) diff --git a/pyproject.toml b/pyproject.toml index faacac3c21..5c65987c2b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,7 +46,7 @@ platforms = ["win-64", "linux-64", "osx-64", "osx-arm64"] [tool.pixi.tasks] tests = "pytest" -tests-notebooks = "pytest -v -s --nbval-lax -k 'not documentation and not tutorial_periodic_boundaries and not tutorial_timevaryingdepthdimensions and not tutorial_particle_field_interaction and not tutorial_croco_3D and not tutorial_nemo_3D'" # TODO v4: Mirror ci.yml for notebooks being run +tests-notebooks = "pytest -v -s --nbval-lax -k 'not documentation and not tutorial_periodic_boundaries and not tutorial_timevaryingdepthdimensions and not tutorial_particle_field_interaction and not tutorial_croco_3D and not tutorial_nemo_3D and not tutorial_analyticaladvection'" # TODO v4: Mirror ci.yml for notebooks being run coverage = "coverage run -m pytest && coverage html" typing = "mypy parcels" pre-commit = "pre-commit run --all-files" diff --git a/tests/test_advection.py b/tests/test_advection.py index ca25f25c9b..a62fe878dd 100644 --- a/tests/test_advection.py +++ b/tests/test_advection.py @@ -634,6 +634,8 @@ def test_analyticalAgrid(): pset.execute(AdvectionAnalytical, runtime=1) +@pytest.mark.v4alpha +@pytest.mark.xfail(reason="GH1927") @pytest.mark.parametrize("u", [1, -0.2, -0.3, 0]) @pytest.mark.parametrize("v", [1, -0.3, 0, -1]) @pytest.mark.parametrize("w", [None, 1, -0.3, 0, -1])