Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions parcels/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down
1 change: 0 additions & 1 deletion parcels/particlefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 1 addition & 4 deletions parcels/particleset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions tests/test_advection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
Loading