From a02d1bd984739489a65b10bbdc8be7335145d82e Mon Sep 17 00:00:00 2001 From: Seth Siegel Date: Mon, 26 Aug 2024 09:26:51 -0700 Subject: [PATCH] fix(profile): allow for computing all times with old method --- fitburst/routines/profile.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fitburst/routines/profile.py b/fitburst/routines/profile.py index b0272d2..2522e0f 100644 --- a/fitburst/routines/profile.py +++ b/fitburst/routines/profile.py @@ -149,7 +149,9 @@ def _identify_pbf_regime(arg: float, threshold=-20.0): invalid = np.flatnonzero(~flag) if valid.size < flag.size else None # If possible, convert from indices to slices so that a copy does not occur - if (valid[-1] + 1 - valid[0]) == valid.size: + if valid.size == 0: + valid = None + elif (valid[-1] + 1 - valid[0]) == valid.size: valid = slice(valid[0], valid[-1]+1) if invalid is not None and (invalid[-1] + 1 - invalid[0]) == invalid.size: