Skip to content

Commit

Permalink
Rename ParticleFile._analytical to ._is_analytical
Browse files Browse the repository at this point in the history
  • Loading branch information
VeckoTheGecko committed Oct 22, 2024
1 parent c8d5deb commit f03f80e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion parcels/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ def check_fieldsets_in_kernels(self, pyfunc):
)
elif pyfunc is AdvectionAnalytical:
if self.fieldset.particlefile is not None:
self.fieldset.particlefile._analytical = True
self.fieldset.particlefile._is_analytical = True
if self._ptype.uses_jit:
raise NotImplementedError("Analytical Advection only works in Scipy mode")
if self._fieldset.U.interp_method != "cgrid_velocity":
Expand Down
4 changes: 2 additions & 2 deletions parcels/particlefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def __init__(self, name, particleset, outputdt=np.inf, chunks=None, create_new_z
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._analytical = False # Flag to indicate if ParticleFile is used for analytical trajectories
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 Expand Up @@ -172,7 +172,7 @@ def fill_value_map(self):
@property
@deprecated_made_private # TODO: Remove 6 months after v3.1.0
def analytical(self):
return self._analytical
return self._is_analytical

Check warning on line 175 in parcels/particlefile.py

View check run for this annotation

Codecov / codecov/patch

parcels/particlefile.py#L175

Added line #L175 was not covered by tests

def _create_variables_attribute_dict(self):
"""Creates the dictionary with variable attributes.
Expand Down
2 changes: 1 addition & 1 deletion parcels/particleset.py
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,7 @@ def execute(

if abs(time - next_output) < tol:
if output_file:
if output_file._analytical: # output analytical solution at later time
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)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_deprecations.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def test_testing_action_class():
Action("ParticleFile", "pids_written", "make_private" ),
Action("ParticleFile", "mpi_rank", "make_private" ),
Action("ParticleFile", "fill_value_map", "make_private" ),
Action("ParticleFile", "analytical", "make_private" ),
Action("ParticleFile", "analytical", "make_private" , skip_reason = "Was also renamed"),
Action("Grid", "lon_grid_to_target()", "remove" ),
Action("Grid", "lon_remapping", "remove" ),
Action("Grid", "lon_grid_to_source()", "remove" ),
Expand Down

0 comments on commit f03f80e

Please sign in to comment.