From 7a75ad0d344b83bdf4de9e12260c0e9628c8008c Mon Sep 17 00:00:00 2001 From: Lionel GUEZ <guez@lmd.ens.fr> Date: Tue, 7 May 2024 15:49:23 +0200 Subject: [PATCH] Remove argument `i_slice` of `comp_ishape` Since getting `i_slice` is now cheaper. --- Common/util_eddies.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Common/util_eddies.py b/Common/util_eddies.py index 76de32ce..57e330ad 100644 --- a/Common/util_eddies.py +++ b/Common/util_eddies.py @@ -221,18 +221,15 @@ class SHPC_class: assert date_index >= self.d_init[0] return self._i_slice[date_index - self.d_init[0]] - def comp_ishape(self, date, eddy_index, orientation, i_slice=None): + def comp_ishape(self, date, eddy_index, orientation): """Compute the location in the shapefiles: return `(i_slice, ishape)`. - Compute i_slice if i_slice is None. - Returns None if ishape_last is None. Crashes if i_slice is not - None and date is not in i_slice. Returns None if eddy_index is - greater than the maximum value. + Returns None if ishape_last is None. Returns None if + eddy_index is greater than the maximum value. """ - if i_slice is None: - i_slice = self.get_slice(date) + i_slice = self.get_slice(date) ishape_last = self.get_ishape_last(i_slice, orientation) -- GitLab