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
23 changes: 0 additions & 23 deletions src/parcels/_core/fieldset.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,29 +139,6 @@ def time_interval(self):

return overlap

def add_field(self, field: Field, name: str | None = None):
"""Add a :class:`parcels.field.Field` object to the FieldSet.

Parameters
----------
field : parcels.field.Field
Field object to be added
name : str
Name of the :class:`parcels.field.Field` object to be added. Defaults
to name in Field object.
"""
if not isinstance(field, (Field, VectorField)):
raise ValueError(f"Expected `field` to be a Field or VectorField object. Got {type(field)}")
assert_compatible_calendars((*self.fields.values(), field))

name = field.name if name is None else name

if name in self.fields:
raise ValueError(f"FieldSet already has a Field with name '{name}'")

self.fields[name] = field
_warn_if_fields_use_different_meshes(self.fields.values())

def to_windowed_arrays(self, *, max_levels: int | None = None):
"""Wrap dask-backed field data in rolling time-window caches.

Expand Down
2 changes: 1 addition & 1 deletion tests/test_compat_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def assert_valid_v3_particlefile_structure(ds: xr.Dataset):
assert ds["lat"].attrs["axis"] == "Y" # attrs are copied accross correctly


@settings(deadline=timedelta(seconds=0.3))
@settings(deadline=timedelta(seconds=1))
@example(buf=example_particlefile())
@given(buf=pst.particlefile_output())
def test_particlefile_to_v3_zarr(buf):
Expand Down
5 changes: 0 additions & 5 deletions tests/test_fieldset.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,6 @@ def test_fieldset_grid_deduplication():
...


def test_fieldset_add_field_after_pset():
# ? Should it be allowed to add fields (normal or vector) after a ParticleSet has been initialized?
...


def test_fieldset_from_icon():
ds = convert.icon_to_ugrid(datasets_unstructured["icon_square_delaunay_uniform_z_coordinate"])
fieldset = FieldSet.from_ugrid_conventions(ds)
Expand Down
Loading