Skip to content

Commit c88ddc3

Browse files
Merge pull request #165 from pfizer-opensource/development
Version 0.16.3
2 parents d4e65b8 + 3670352 commit c88ddc3

File tree

18 files changed

+70
-58
lines changed

18 files changed

+70
-58
lines changed

docs/src/research.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ SKDH Research
55
Peer Reviewed Journal Articles Using SKDH
66
=========================================
77

8+
- N. Camerlingo et al., “Measuring gait parameters from a single chest-worn accelerometer in healthy individuals: a validation study,” Sci Rep, vol. 14, no. 1, p. 13897, Jun. 2024, doi: 10.1038/s41598-024-62330-6.
89
- W. Lin et al., “Can Gait Characteristics Be Represented by Physical Activity Measured with Wrist-Worn Accelerometers?,” Sensors, vol. 23, no. 20, Art. no. 20, Jan. 2023, doi: 10.3390/s23208542.
910
- W. Lin et al., "SciKit Digital Health Package for Accelerometry-Measured Physical Activity: Comparisons to Existing Solutions and Investigations of Age Effects in Healthy Adults", Front. Digit. Health, 26 Nov. 2023, doi: 10.3389/fdgth.2023.1321086
1011
- J. Di et al., “Monitoring Activity and Gait in Children (MAGIC) using digital health technologies,” Pediatr Res, Mar. 2024, doi: 10.1038/s41390-024-03147-x.

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.16.2',
4+
version: '0.16.3',
55
license: 'MIT',
66
meson_version: '>=1.1',
77
)

pyproject.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
requires = [
33
"meson-python",
44
"wheel",
5-
"oldest-supported-numpy"
5+
"numpy>=2.0.0rc1"
66
]
77
build-backend = "mesonpy"
88

@@ -47,7 +47,7 @@ classifiers = [
4747

4848
requires-python = ">=3.9"
4949
dependencies = [
50-
"numpy>=1.17.2",
50+
"numpy>=1.25.0",
5151
"scipy>=1.12.0",
5252
"pandas>=1.0.0",
5353
"lightgbm>=2.3.0",
@@ -65,7 +65,8 @@ dev = [
6565
'pytest',
6666
'coverage',
6767
'psutil',
68-
'tables'
68+
# 'tables',
69+
"numpy>=2.0.0rc1"
6970
]
7071
actions = [
7172
'flake8',

src/skdh/features/core.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from warnings import warn
1212

1313
from pandas import DataFrame
14-
from numpy import float_, asarray, zeros, sum, moveaxis
14+
from numpy import float64, asarray, zeros, sum, moveaxis
1515

1616

1717
__all__ = ["Bank"]
@@ -262,10 +262,10 @@ def compute(
262262
# standardize the input signal
263263
if isinstance(signal, DataFrame):
264264
columns = columns if columns is not None else signal.columns
265-
x = signal[columns].values.astype(float_)
265+
x = signal[columns].values.astype(float64)
266266
else:
267267
try:
268-
x = asarray(signal, dtype=float_)
268+
x = asarray(signal, dtype=float64)
269269
except ValueError as e:
270270
raise ArrayConversionError("Error converting signal to ndarray") from e
271271

@@ -285,7 +285,7 @@ def compute(
285285
x = moveaxis(x, axis, -1)
286286
# number of feats is 1 per
287287
n_feats = [1] * len(self)
288-
feats = zeros((sum(n_feats),) + x.shape[:-1], dtype=float_)
288+
feats = zeros((sum(n_feats),) + x.shape[:-1], dtype=float64)
289289
else:
290290
# move both the computation and index axis. do this in two steps to allow for undoing
291291
# just the index axis swap later. The index_axis has been adjusted appropriately
@@ -297,7 +297,7 @@ def compute(
297297
for ind in indices:
298298
n_feats.append(get_n_feats(x.shape[0], ind))
299299

300-
feats = zeros((sum(n_feats),) + x.shape[1:-1], dtype=float_)
300+
feats = zeros((sum(n_feats),) + x.shape[1:-1], dtype=float64)
301301

302302
feat_i = 0 # keep track of where in the feature array we are
303303
for i, ft in enumerate(self._feats):
@@ -367,4 +367,4 @@ def compute(self, signal, fs=1.0, *, axis=-1):
367367
ndarray of the computed feature
368368
"""
369369
# move the computation axis to the end
370-
return moveaxis(asarray(signal, dtype=float_), axis, -1)
370+
return moveaxis(asarray(signal, dtype=float64), axis, -1)

src/skdh/gait/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ def __init__(self):
280280
281281
def _predict(self, dt, leg_length, gait, gait_aux):
282282
# initialize 1 value per bout
283-
stepreg = zeros(len(gait_aux['accel']), dtype=float_)
283+
stepreg = zeros(len(gait_aux['accel']), dtype=float64)
284284
285285
for i, acc in enumerate(gait_aux['accel']):
286286
lag = int(

src/skdh/gait/gait_metrics/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import functools
99
import logging
1010

11-
from numpy import zeros, roll, full, nan, bool_, float_
11+
from numpy import zeros, roll, full, nan, bool_, float64
1212

1313

1414
def basic_asymmetry(f):
@@ -134,7 +134,7 @@ def predict(self, *, fs, leg_length, gait, gait_aux):
134134

135135
def _predict_asymmetry(self, *, fs, leg_length, gait, gait_aux):
136136
asy_name = f"{self.k_} asymmetry"
137-
gait[asy_name] = full(gait["IC"].size, nan, dtype=float_)
137+
gait[asy_name] = full(gait["IC"].size, nan, dtype=float64)
138138

139139
mask = self._get_mask(gait, 1)
140140
mask_ofst = roll(mask, 1)
@@ -143,7 +143,7 @@ def _predict_asymmetry(self, *, fs, leg_length, gait, gait_aux):
143143

144144
def _predict_init(self, gait, init=True, offset=None):
145145
if init:
146-
gait[self.k_] = full(gait["IC"].size, nan, dtype=float_)
146+
gait[self.k_] = full(gait["IC"].size, nan, dtype=float64)
147147
if offset is not None:
148148
mask = self._get_mask(gait, offset)
149149
mask_ofst = roll(mask, offset)

src/skdh/gait/gait_metrics/gait_metrics.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
argmin,
4545
abs,
4646
round,
47-
float_,
47+
float64,
4848
int_,
4949
fft,
5050
arange,
@@ -101,7 +101,7 @@ def _autocovariancefn(x, max_lag, biased=False, axis=0):
101101

102102
shape = list(y.shape)
103103
shape[-1] = max_lag
104-
ac = zeros(shape, dtype=float_)
104+
ac = zeros(shape, dtype=float64)
105105

106106
for i in range(min(max_lag, y.shape[-1] - 10)):
107107
ac[..., i] = autocorrelation(y, i, True)
@@ -796,7 +796,7 @@ def __init__(self):
796796
)
797797

798798
def _predict(self, *, fs, leg_length, gait, gait_aux):
799-
pci = zeros(len(gait_aux["accel"]), dtype=float_)
799+
pci = zeros(len(gait_aux["accel"]), dtype=float64)
800800

801801
phase = gait["step time"] / gait["stride time"] # %, not degrees
802802
for i in range(len(gait_aux["accel"])):
@@ -869,7 +869,7 @@ def __init__(self):
869869
super().__init__("gait symmetry index", __name__, depends=[StrideTime])
870870

871871
def _predict(self, *, fs, leg_length, gait, gait_aux):
872-
gsi = zeros(len(gait_aux["accel"]), dtype=float_)
872+
gsi = zeros(len(gait_aux["accel"]), dtype=float64)
873873

874874
# setup acceleration filter if its possible to use
875875
if 0 < (2 * 10 / fs) < 1:
@@ -942,7 +942,7 @@ def __init__(self):
942942
super().__init__("step regularity - V", __name__, depends=[StepTime])
943943

944944
def _predict(self, *, fs, leg_length, gait, gait_aux):
945-
stepreg = full(len(gait_aux["accel"]), nan, dtype=float_)
945+
stepreg = full(len(gait_aux["accel"]), nan, dtype=float64)
946946

947947
for i in unique(gait_aux["inertial data i"]):
948948
acc = gait_aux["accel"][i]
@@ -1002,7 +1002,7 @@ def __init__(self):
10021002
super().__init__("stride regularity - V", __name__, depends=[StrideTime])
10031003

10041004
def _predict(self, *, fs, leg_length, gait, gait_aux):
1005-
stridereg = full(len(gait_aux["accel"]), nan, dtype=float_)
1005+
stridereg = full(len(gait_aux["accel"]), nan, dtype=float64)
10061006

10071007
for i in unique(gait_aux["inertial data i"]):
10081008
acc = gait_aux["accel"][i]

src/skdh/gait_old/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def __init__(self):
174174
175175
def _predict(self, dt, leg_length, gait, gait_aux):
176176
# initialize 1 value per bout
177-
stepreg = zeros(len(gait_aux['accel']), dtype=float_)
177+
stepreg = zeros(len(gait_aux['accel']), dtype=float64)
178178
179179
for i, acc in enumerate(gait_aux['accel']):
180180
lag = int(

src/skdh/gait_old/gait_endpoints/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import functools
99
import logging
1010

11-
from numpy import zeros, roll, full, nan, bool_, float_
11+
from numpy import zeros, roll, full, nan, bool_, float64
1212

1313

1414
def basic_asymmetry(f):
@@ -130,7 +130,7 @@ def predict(self, fs, leg_length, gait, gait_aux):
130130

131131
def _predict_asymmetry(self, dt, leg_length, gait, gait_aux):
132132
asy_name = f"{self.k_} asymmetry"
133-
gait[asy_name] = full(gait["IC"].size, nan, dtype=float_)
133+
gait[asy_name] = full(gait["IC"].size, nan, dtype=float64)
134134

135135
mask = self._get_mask(gait, 1)
136136
mask_ofst = roll(mask, 1)
@@ -139,7 +139,7 @@ def _predict_asymmetry(self, dt, leg_length, gait, gait_aux):
139139

140140
def _predict_init(self, gait, init=True, offset=None):
141141
if init:
142-
gait[self.k_] = full(gait["IC"].size, nan, dtype=float_)
142+
gait[self.k_] = full(gait["IC"].size, nan, dtype=float64)
143143
if offset is not None:
144144
mask = self._get_mask(gait, offset)
145145
mask_ofst = roll(mask, offset)

src/skdh/gait_old/gait_endpoints/gait_endpoints.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
argmin,
4545
abs,
4646
round,
47-
float_,
47+
float64,
4848
int_,
4949
fft,
5050
arange,
@@ -97,7 +97,7 @@ def _autocovariancefn(x, max_lag, biased=False, axis=0):
9797

9898
shape = list(y.shape)
9999
shape[-1] = max_lag
100-
ac = zeros(shape, dtype=float_)
100+
ac = zeros(shape, dtype=float64)
101101

102102
for i in range(min(max_lag, y.shape[-1] - 10)):
103103
ac[..., i] = autocorrelation(y, i, True)
@@ -592,7 +592,7 @@ def __init__(self):
592592
)
593593

594594
def _predict(self, fs, leg_length, gait, gait_aux):
595-
pci = zeros(len(gait_aux["accel"]), dtype=float_)
595+
pci = zeros(len(gait_aux["accel"]), dtype=float64)
596596

597597
phase = gait["PARAM:step time"] / gait["PARAM:stride time"] # %, not degrees
598598
for i in range(len(gait_aux["accel"])):
@@ -665,7 +665,7 @@ def __init__(self):
665665
super().__init__("gait symmetry index", __name__, depends=[StrideTime])
666666

667667
def _predict(self, fs, leg_length, gait, gait_aux):
668-
gsi = zeros(len(gait_aux["accel"]), dtype=float_)
668+
gsi = zeros(len(gait_aux["accel"]), dtype=float64)
669669

670670
# setup acceleration filter if its possible to use
671671
if 0 < (2 * 10 / fs) < 1:
@@ -741,7 +741,7 @@ def __init__(self):
741741
super().__init__("step regularity - V", __name__, depends=[StepTime])
742742

743743
def _predict(self, fs, leg_length, gait, gait_aux):
744-
stepreg = full(len(gait_aux["accel"]), nan, dtype=float_)
744+
stepreg = full(len(gait_aux["accel"]), nan, dtype=float64)
745745

746746
for i in unique(gait_aux["inertial data i"]):
747747
acc = gait_aux["accel"][i]
@@ -801,7 +801,7 @@ def __init__(self):
801801
super().__init__("stride regularity - V", __name__, depends=[StrideTime])
802802

803803
def _predict(self, fs, leg_length, gait, gait_aux):
804-
stridereg = full(len(gait_aux["accel"]), nan, dtype=float_)
804+
stridereg = full(len(gait_aux["accel"]), nan, dtype=float64)
805805

806806
for i in unique(gait_aux["inertial data i"]):
807807
acc = gait_aux["accel"][i]

0 commit comments

Comments
 (0)