Skip to content

Commit c5273e2

Browse files
Merge pull request #1928 from OceanParcels/analytical-writing
Remove analytical output
2 parents 3c21377 + 14309b3 commit c5273e2

File tree

6 files changed

+6
-9
lines changed

6 files changed

+6
-9
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@ jobs:
8181
# TODO v4: Re-enable `tutorial_particle_field_interaction`
8282
# TODO v4: Re-enable `tutorial_croco_3D`
8383
# TODO v4: Re-enable `tutorial_nemo_3D` (https://github.com/OceanParcels/Parcels/pull/1936#issuecomment-2717666705)
84+
# TODO v4: Re-enable `tutorial_analyticaladvection`
8485
run: |
85-
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
86+
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
8687
coverage xml
8788
- name: Codecov
8889
uses: codecov/[email protected]

parcels/kernel.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,6 @@ def check_fieldsets_in_kernels(self, pyfunc): # TODO v4: this can go into anoth
208208
"""
209209
if self.fieldset is not None:
210210
if pyfunc is AdvectionAnalytical:
211-
if self.fieldset.particlefile is not None:
212-
self.fieldset.particlefile._is_analytical = True
213211
if self._fieldset.U.interp_method != "cgrid_velocity":
214212
raise NotImplementedError("Analytical Advection only works with C-grids")
215213
if self._fieldset.U.grid._gtype not in [GridType.CurvilinearZGrid, GridType.RectilinearZGrid]:

parcels/particlefile.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ def __init__(self, name, particleset, outputdt, chunks=None, create_new_zarrfile
6464
self.vars_to_write[var.name] = var.dtype
6565
self._mpi_rank = MPI.COMM_WORLD.Get_rank() if MPI else 0
6666
self.particleset.fieldset._particlefile = self
67-
self._is_analytical = False # Flag to indicate if ParticleFile is used for analytical trajectories
6867

6968
# Reset obs_written of each particle, in case new ParticleFile created for a ParticleSet
7069
particleset.particledata.setallvardata("obs_written", 0)

parcels/particleset.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,10 +1078,7 @@ def execute(
10781078

10791079
if abs(time - next_output) < tol:
10801080
if output_file:
1081-
if output_file._is_analytical: # output analytical solution at later time
1082-
output_file.write_latest_locations(self, time)
1083-
else:
1084-
output_file.write(self, time_at_startofloop)
1081+
output_file.write(self, time_at_startofloop)
10851082
if np.isfinite(outputdt):
10861083
next_output += outputdt * np.sign(dt)
10871084

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ platforms = ["win-64", "linux-64", "osx-64", "osx-arm64"]
4646

4747
[tool.pixi.tasks]
4848
tests = "pytest"
49-
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
49+
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
5050
coverage = "coverage run -m pytest && coverage html"
5151
typing = "mypy parcels"
5252
pre-commit = "pre-commit run --all-files"

tests/test_advection.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,8 @@ def test_analyticalAgrid():
634634
pset.execute(AdvectionAnalytical, runtime=1)
635635

636636

637+
@pytest.mark.v4alpha
638+
@pytest.mark.xfail(reason="GH1927")
637639
@pytest.mark.parametrize("u", [1, -0.2, -0.3, 0])
638640
@pytest.mark.parametrize("v", [1, -0.3, 0, -1])
639641
@pytest.mark.parametrize("w", [None, 1, -0.3, 0, -1])

0 commit comments

Comments
 (0)