Skip to content

Commit

Permalink
Fix E721
Browse files Browse the repository at this point in the history
  • Loading branch information
VeckoTheGecko committed Jul 30, 2023
1 parent bf98c97 commit fc60919
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions parcels/particlefile/baseparticlefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,12 @@ def write(self, pset, time, deleted_only=False):
if deleted_only is not False:
if type(deleted_only) not in [list, np.ndarray] and deleted_only in [True, 1]:
indices_to_write = np.where(np.isin(pset.collection.getvardata('state'), [OperationCode.Delete]))[0]
elif type(deleted_only) == np.ndarray:
elif type(deleted_only) is np.ndarray:

Check warning on line 239 in parcels/particlefile/baseparticlefile.py

View check run for this annotation

Codecov / codecov/patch

parcels/particlefile/baseparticlefile.py#L239

Added line #L239 was not covered by tests
if set(deleted_only).issubset([0, 1]):
indices_to_write = np.where(deleted_only)[0]
else:
indices_to_write = deleted_only
elif type(deleted_only) == list:
elif type(deleted_only) is list:

Check warning on line 244 in parcels/particlefile/baseparticlefile.py

View check run for this annotation

Codecov / codecov/patch

parcels/particlefile/baseparticlefile.py#L244

Added line #L244 was not covered by tests
indices_to_write = np.array(deleted_only)
else:
indices_to_write = pset.collection._to_write_particles(pset.collection._data, time)
Expand Down

0 comments on commit fc60919

Please sign in to comment.