Skip to content

Commit 5742560

Browse files
committed
Remove some references to c_int
1 parent 3c75589 commit 5742560

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

parcels/field.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,10 +1015,7 @@ def _time_index(self, time):
10151015
periods = int(
10161016
math.floor((time - self.grid.time_full[0]) / (self.grid.time_full[-1] - self.grid.time_full[0]))
10171017
)
1018-
if isinstance(self.grid.periods, c_int):
1019-
self.grid.periods.value = periods
1020-
else:
1021-
self.grid.periods = periods
1018+
self.grid.periods = periods
10221019
time -= periods * (self.grid.time_full[-1] - self.grid.time_full[0])
10231020
time_index = self.grid.time <= time
10241021
ti = time_index.argmin() - 1 if time_index.any() else 0

parcels/grid.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import functools
22
import warnings
3-
from ctypes import c_int
43
from enum import IntEnum
54

65
import numpy as np
@@ -208,7 +207,7 @@ def _add_Sdepth_periodic_halo(self, zonal, meridional, halosize):
208207

209208
def _computeTimeChunk(self, f, time, signdt):
210209
nextTime_loc = np.inf if signdt >= 0 else -np.inf
211-
periods = self.periods.value if isinstance(self.periods, c_int) else self.periods
210+
periods = self.periods
212211
prev_time_indices = self.time
213212
if self._update_status == "not_updated":
214213
if self._ti >= 0:
@@ -246,7 +245,7 @@ def _computeTimeChunk(self, f, time, signdt):
246245
if self._ti == -1:
247246
self.time = self.time_full
248247
self._ti, _ = f._time_index(time)
249-
periods = self.periods.value if isinstance(self.periods, c_int) else self.periods
248+
periods = self.periods
250249
if (
251250
signdt == -1
252251
and self._ti == 0

parcels/particledata.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ def __init__(self, pclass, lon, lat, depth, time, lonlatdepth_dtype, pid_orig, n
4141
Parameters
4242
----------
4343
ngrid :
44-
number of grids in the fieldset of the overarching ParticleSet - required for initialising the
45-
field references of the ctypes-link of particles that are allocated
44+
number of grids in the fieldset of the overarching ParticleSet.
4645
"""
4746
self._ncount = -1
4847
self._pu_indicators = None

0 commit comments

Comments
 (0)