Skip to content

Commit a0de3d6

Browse files
Merge pull request #186 from pfizer-opensource/development
Version 0.17.4
2 parents e9a26c9 + 1fec3c4 commit a0de3d6

16 files changed

+38
-6
lines changed

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
project(
22
'scikit-digital-health',
33
'c',
4-
version: '0.17.3',
4+
version: '0.17.4',
55
license: 'MIT',
66
meson_version: '>=1.1',
77
)

src/skdh/preprocessing/window_days.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ def finalize_guess(time, fs, guess, target):
4242
if i2 <= 0:
4343
return 0
4444
if i2 >= (time.size - 1):
45-
return time.size - 1
45+
if time[-1] > ts_target:
46+
i2 = i3 - 1
47+
i1 = i3 - 2
48+
else:
49+
return time.size - 1
4650

4751
check1 = abs(time[i2] - ts_target) <= abs(time[i1] - ts_target)
4852
check3 = abs(time[i2] - ts_target) <= abs(time[i3] - ts_target)

src/skdh/utility/internal.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,8 @@ def resample(x, factor, t, t_rs):
235235
if int(fs / goal_fs) == fs / goal_fs and goal_fs < fs:
236236
time_rs = time[:: int(fs / goal_fs)]
237237
else:
238-
time_rs = arange(time[0], time[-1], 1 / goal_fs)
238+
# round-about way, but need to prevent start>>>>>>>>>step
239+
time_rs = arange(0, (time[-1] - time[0]) + 0.5 / goal_fs, 1 / goal_fs) + time[0]
239240
else:
240241
goal_fs = 1 / mean(diff(time_rs[:5000]))
241242
# prevent t_rs from extrapolating
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
172 Bytes
Binary file not shown.
-732 Bytes
Binary file not shown.
-36 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)