Skip to content

Commit

Permalink
Make FieldSet.add_UVfield() private
Browse files Browse the repository at this point in the history
  • Loading branch information
VeckoTheGecko committed Sep 23, 2024
1 parent 35bb37c commit 54a563a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions parcels/fieldset.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def __init__(self, U: Field | NestedField | None, V: Field | NestedField | None,
self.add_field(field, name)

self.compute_on_defer = None
self.add_UVfield()
self._add_UVfield()

Check warning on line 57 in parcels/fieldset.py

View check run for this annotation

Codecov / codecov/patch

parcels/fieldset.py#L57

Added line #L57 was not covered by tests

@property
def particlefile(self):
Expand Down Expand Up @@ -245,7 +245,11 @@ def add_vector_field(self, vfield):
for f in vfield:
f.fieldset = self

def add_UVfield(self):
@deprecated_made_private # TODO: Remove 6 months after v3.1.0
def add_UVfield(self, *args, **kwargs):
return self._add_UVfield(*args, **kwargs)

Check warning on line 250 in parcels/fieldset.py

View check run for this annotation

Codecov / codecov/patch

parcels/fieldset.py#L249-L250

Added lines #L249 - L250 were not covered by tests

def _add_UVfield(self):

Check warning on line 252 in parcels/fieldset.py

View check run for this annotation

Codecov / codecov/patch

parcels/fieldset.py#L252

Added line #L252 was not covered by tests
if not hasattr(self, "UV") and hasattr(self, "U") and hasattr(self, "V"):
if isinstance(self.U, NestedField):
self.add_vector_field(NestedField("UV", self.U, self.V))
Expand Down Expand Up @@ -313,7 +317,7 @@ def check_velocityfields(U, V, W):
if g.defer_load:
g.time_full = g.time_full + self.time_origin.reltime(g.time_origin)
g.time_origin = self.time_origin
self.add_UVfield()
self._add_UVfield()

Check warning on line 320 in parcels/fieldset.py

View check run for this annotation

Codecov / codecov/patch

parcels/fieldset.py#L320

Added line #L320 was not covered by tests

ccode_fieldnames = []
counter = 1
Expand Down

0 comments on commit 54a563a

Please sign in to comment.