diff --git a/seaduck/lagrangian.py b/seaduck/lagrangian.py index 63bf5b67..96e11579 100644 --- a/seaduck/lagrangian.py +++ b/seaduck/lagrangian.py @@ -798,6 +798,7 @@ def to_list_of_time( update_stops="default", return_in_between=True, dump_filename=False, + store_kwarg={}, ): """Integrate the particles to a list of time. @@ -881,12 +882,12 @@ def to_list_of_time( self.get_u_du() if return_in_between: if dump_filename: - store_lists(self, dump_filename + timestr) + store_lists(self, dump_filename + timestr, **store_kwarg) else: to_return.append(self.deepcopy()) else: if dump_filename: - store_lists(self, dump_filename + timestr) + store_lists(self, dump_filename + timestr, **store_kwarg) else: to_return.append(self.deepcopy()) if self.save_raw: diff --git a/seaduck/runtime_conf.py b/seaduck/runtime_conf.py index a00ed9ee..05cd9770 100644 --- a/seaduck/runtime_conf.py +++ b/seaduck/runtime_conf.py @@ -4,7 +4,6 @@ } try: # pragma: no cover - import numba from numba import njit rcParam["compilable"] = True @@ -26,11 +25,3 @@ def compileable_parallel(func): # pragma: no cover return njit(func, parallel=True) else: return func - - -def prange(*arg): # pragma: no cover - """Decorate function to compile them (parallel) using numba when available.""" - if rcParam["compilable"]: - return numba.prange(*arg) - else: - return range(*arg) diff --git a/seaduck/utils.py b/seaduck/utils.py index 94f6bd05..d66b9435 100644 --- a/seaduck/utils.py +++ b/seaduck/utils.py @@ -7,7 +7,7 @@ import xarray as xr from scipy import spatial -from seaduck.runtime_conf import compileable, compileable_parallel, prange +from seaduck.runtime_conf import compileable, compileable_parallel try: import pooch @@ -726,7 +726,7 @@ def pointinpolygon(x, y, poly): p2y = 0.0 xints = 0.0 p1x, p1y = poly[0] - for i in prange(n + 1): + for i in range(n + 1): p2x, p2y = poly[i % n] if y > min(p1y, p2y): if y <= max(p1y, p2y): @@ -743,7 +743,7 @@ def pointinpolygon(x, y, poly): @compileable_parallel def parallelpointinpolygon(xs, ys, poly): D = np.empty(len(xs), dtype=bool) - for i in prange(0, len(D)): + for i in range(0, len(D)): D[i] = pointinpolygon(xs[i], ys[i], poly) return D