diff --git a/meson.build b/meson.build index e422f3a6..4781204f 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project( 'scikit-digital-health', 'c', - version: '0.17.2', + version: '0.17.3', license: 'MIT', meson_version: '>=1.1', ) diff --git a/src/skdh/io/base.py b/src/skdh/io/base.py index 79bc68ac..4836a069 100644 --- a/src/skdh/io/base.py +++ b/src/skdh/io/base.py @@ -173,8 +173,8 @@ def trim_data(self, start_key, end_key, tz_name, predict_kw, *, time, **data): # write it so that if there is any time weirdness, get the data from the "middle", # ie the last index before the start time, and the first index after the end time. - i1 = nonzero(time <= ts_trim_start)[0][-1] - i2 = nonzero(time >= ts_trim_end)[0][0] + i1 = nonzero(time <= max(time[0], ts_trim_start))[0][-1] + i2 = nonzero(time >= min(time[-1], ts_trim_end))[0][0] res = {self._time: time[i1:i2]} res.update({k: v[i1:i2] for k, v in data.items()})