biomechzoo 0.4.8__tar.gz → 0.4.10__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of biomechzoo might be problematic. Click here for more details.
- {biomechzoo-0.4.8/src/biomechzoo.egg-info → biomechzoo-0.4.10}/PKG-INFO +2 -1
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/README.md +1 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/pyproject.toml +1 -1
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/biomechzoo.py +9 -27
- biomechzoo-0.4.8/src/biomechzoo/conversion/csv2zoo_data.py → biomechzoo-0.4.10/src/biomechzoo/conversion/table2zoo_data.py +5 -2
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/processing/addevent_data.py +10 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10/src/biomechzoo.egg-info}/PKG-INFO +2 -1
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo.egg-info/SOURCES.txt +1 -1
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/LICENSE +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/setup.cfg +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/__init__.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/__init__.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/__main__.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/biomech_ops/__init__.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/biomech_ops/continuous_relative_phase_data.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/biomech_ops/continuous_relative_phase_line.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/biomech_ops/filter_data.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/biomech_ops/filter_line.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/biomech_ops/normalize_data.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/biomech_ops/normalize_line.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/biomech_ops/phase_angle_data.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/biomech_ops/phase_angle_line.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/conversion/__init__.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/conversion/c3d2zoo_data.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/conversion/mvnx2zoo_data.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/conversion/opencap2zoo_data.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/mvn/__init__.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/mvn/load_mvnx.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/mvn/main_mvnx.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/mvn/mvn.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/mvn/mvnx_file_accessor.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/processing/__init__.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/processing/add_channel_data.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/processing/addchannel_data.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/processing/explodechannel_data.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/processing/partition_data.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/processing/removechannel_data.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/processing/renamechannel_data.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/processing/renameevent_data.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/processing/split_trial_by_gait_cycle.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/utils/__init__.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/utils/batchdisp.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/utils/compute_sampling_rate_from_time.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/utils/engine.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/utils/findfield.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/utils/get_split_events.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/utils/set_zoosystem.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/utils/split_trial.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/utils/version.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/utils/zload.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/utils/zplot.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/utils/zsave.py +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo.egg-info/dependency_links.txt +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo.egg-info/entry_points.txt +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo.egg-info/requires.txt +0 -0
- {biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: biomechzoo
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.10
|
|
4
4
|
Summary: Python implementation of the biomechZoo toolbox
|
|
5
5
|
License-Expression: MIT
|
|
6
6
|
Project-URL: Homepage, https://github.com/mcgillmotionlab/biomechzoo
|
|
@@ -37,6 +37,7 @@ See also http://www.github.com/mcgillmotionlab/biomechzoo or http://www.biomechz
|
|
|
37
37
|
### Installing a dev environment
|
|
38
38
|
conda create -n biomechzoo-dev python=3.11
|
|
39
39
|
conda activate biomechzoo-dev
|
|
40
|
+
cd biomechzoo root folder
|
|
40
41
|
pip install -e ".[dev]"
|
|
41
42
|
|
|
42
43
|
### import issues
|
|
@@ -20,6 +20,7 @@ See also http://www.github.com/mcgillmotionlab/biomechzoo or http://www.biomechz
|
|
|
20
20
|
### Installing a dev environment
|
|
21
21
|
conda create -n biomechzoo-dev python=3.11
|
|
22
22
|
conda activate biomechzoo-dev
|
|
23
|
+
cd biomechzoo root folder
|
|
23
24
|
pip install -e ".[dev]"
|
|
24
25
|
|
|
25
26
|
### import issues
|
|
@@ -8,7 +8,7 @@ from biomechzoo.utils.batchdisp import batchdisp
|
|
|
8
8
|
from biomechzoo.utils.get_split_events import get_split_events
|
|
9
9
|
from biomechzoo.utils.split_trial import split_trial
|
|
10
10
|
from biomechzoo.conversion.c3d2zoo_data import c3d2zoo_data
|
|
11
|
-
from biomechzoo.conversion.
|
|
11
|
+
from biomechzoo.conversion.table2zoo_data import table2zoo_data
|
|
12
12
|
from biomechzoo.conversion.mvnx2zoo_data import mvnx2zoo_data
|
|
13
13
|
from biomechzoo.processing.removechannel_data import removechannel_data
|
|
14
14
|
from biomechzoo.processing.renamechannel_data import renamechannel_data
|
|
@@ -99,36 +99,18 @@ class BiomechZoo:
|
|
|
99
99
|
# Update self.folder after processing
|
|
100
100
|
self._update_folder(out_folder, inplace, in_folder)
|
|
101
101
|
|
|
102
|
-
def
|
|
102
|
+
def table2zoo(self, out_folder=None, inplace=None, skip_rows=0, extension='csv'):
|
|
103
103
|
""" Converts generic .csv file in the folder to .zoo format """
|
|
104
104
|
start_time = time.time()
|
|
105
105
|
verbose = self.verbose
|
|
106
106
|
in_folder = self.in_folder
|
|
107
107
|
if inplace is None:
|
|
108
108
|
inplace = self.inplace
|
|
109
|
-
fl = engine(in_folder, extension=
|
|
109
|
+
fl = engine(in_folder, extension=extension, name_contains=self.name_contains, subfolders=self.subfolders)
|
|
110
110
|
for f in fl:
|
|
111
|
-
batchdisp('converting
|
|
112
|
-
data =
|
|
113
|
-
f_zoo = f.replace(
|
|
114
|
-
zsave(f_zoo, data, inplace=inplace, out_folder=out_folder, root_folder=in_folder)
|
|
115
|
-
method_name = inspect.currentframe().f_code.co_name
|
|
116
|
-
batchdisp('{} process complete for {} file(s) in {:.2f} secs'.format(method_name, len(fl), time.time() - start_time), level=1, verbose=verbose)
|
|
117
|
-
# Update self.folder after processing
|
|
118
|
-
self._update_folder(out_folder, inplace, in_folder)
|
|
119
|
-
|
|
120
|
-
def parquet2zoo(self, out_folder=None, inplace=None):
|
|
121
|
-
""" Converts generic .csv file in the folder to .zoo format """
|
|
122
|
-
start_time = time.time()
|
|
123
|
-
verbose = self.verbose
|
|
124
|
-
in_folder = self.in_folder
|
|
125
|
-
if inplace is None:
|
|
126
|
-
inplace = self.inplace
|
|
127
|
-
fl = engine(in_folder, extension='.parquet', name_contains=self.name_contains, subfolders=self.subfolders)
|
|
128
|
-
for f in fl:
|
|
129
|
-
batchdisp('converting parquet to zoo for {}'.format(f), level=2, verbose=verbose)
|
|
130
|
-
data = csv2zoo_data(f, type='parquet')
|
|
131
|
-
f_zoo = f.replace('.parquet', '.zoo')
|
|
111
|
+
batchdisp('converting {} to zoo for {}'.format(extension, f), level=2, verbose=verbose)
|
|
112
|
+
data = table2zoo_data(f, type=extension, skip_rows=skip_rows)
|
|
113
|
+
f_zoo = f.replace(extension, '.zoo')
|
|
132
114
|
zsave(f_zoo, data, inplace=inplace, out_folder=out_folder, root_folder=in_folder)
|
|
133
115
|
method_name = inspect.currentframe().f_code.co_name
|
|
134
116
|
batchdisp('{} process complete for {} file(s) in {:.2f} secs'.format(method_name, len(fl), time.time() - start_time), level=1, verbose=verbose)
|
|
@@ -324,7 +306,7 @@ class BiomechZoo:
|
|
|
324
306
|
# Update self.folder after processing
|
|
325
307
|
self._update_folder(out_folder, inplace, in_folder)
|
|
326
308
|
|
|
327
|
-
def addevent(self, ch,
|
|
309
|
+
def addevent(self, ch, event_type, event_name, out_folder=None, inplace=None):
|
|
328
310
|
""" adds events of type evt_type with name evt_name to channel ch """
|
|
329
311
|
start_time = time.time()
|
|
330
312
|
verbose = self.verbose
|
|
@@ -334,9 +316,9 @@ class BiomechZoo:
|
|
|
334
316
|
fl = engine(in_folder, extension='.zoo', name_contains=self.name_contains, subfolders=self.subfolders)
|
|
335
317
|
for f in fl:
|
|
336
318
|
if verbose:
|
|
337
|
-
batchdisp('adding event {} to channel {} for {}'.format(
|
|
319
|
+
batchdisp('adding event {} to channel {} for {}'.format(event_type, ch, f), level=2, verbose=verbose)
|
|
338
320
|
data = zload(f)
|
|
339
|
-
data = addevent_data(data, ch,
|
|
321
|
+
data = addevent_data(data, ch, event_type, event_name)
|
|
340
322
|
zsave(f, data, inplace=inplace, out_folder=out_folder, root_folder=in_folder)
|
|
341
323
|
method_name = inspect.currentframe().f_code.co_name
|
|
342
324
|
batchdisp('{} process complete for {} file(s) in {:.2f} secs'.format(method_name, len(fl), time.time() - start_time), level=1, verbose=verbose)
|
|
@@ -6,9 +6,12 @@ from biomechzoo.utils.set_zoosystem import set_zoosystem
|
|
|
6
6
|
from biomechzoo.utils.compute_sampling_rate_from_time import compute_sampling_rate_from_time
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
def
|
|
9
|
+
def table2zoo_data(csv_path, type='csv', skip_rows=0, freq=None):
|
|
10
10
|
# todo: check calculation for sampling rate
|
|
11
11
|
|
|
12
|
+
if type not in ['csv', 'parquet']:
|
|
13
|
+
raise NotImplementedError('Only csv and parquet currently supported')
|
|
14
|
+
|
|
12
15
|
# Read header lines until 'endheader'
|
|
13
16
|
metadata = {}
|
|
14
17
|
if type == 'csv' and skip_rows > 0:
|
|
@@ -99,4 +102,4 @@ if __name__ == '__main__':
|
|
|
99
102
|
project_root = os.path.dirname(current_dir)
|
|
100
103
|
csv_file = os.path.join(project_root, 'data', 'other', 'opencap_walking1.csv')
|
|
101
104
|
|
|
102
|
-
data =
|
|
105
|
+
data = table2zoo_data(csv_file)
|
|
@@ -37,6 +37,11 @@ def addevent_data(data, ch, ename, etype):
|
|
|
37
37
|
elif etype == 'rom':
|
|
38
38
|
eyd = float(np.max(yd) - np.min(yd))
|
|
39
39
|
exd = 0 # dummy index (like MATLAB version)
|
|
40
|
+
elif etype == 'max_stance':
|
|
41
|
+
# special event for gait and running
|
|
42
|
+
exd = max_stance(yd)
|
|
43
|
+
eyd = float(yd[exd])
|
|
44
|
+
eyd = float(yd[exd])
|
|
40
45
|
else:
|
|
41
46
|
raise ValueError(f'Unknown event type: {etype}')
|
|
42
47
|
|
|
@@ -44,3 +49,8 @@ def addevent_data(data, ch, ename, etype):
|
|
|
44
49
|
data[channel]['event'][ename] = [exd, eyd, 0]
|
|
45
50
|
|
|
46
51
|
return data
|
|
52
|
+
|
|
53
|
+
def max_stance(yd):
|
|
54
|
+
""" extracts max from first 40% of the gait cycle"""
|
|
55
|
+
raise NotImplementedError
|
|
56
|
+
return exd
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: biomechzoo
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.10
|
|
4
4
|
Summary: Python implementation of the biomechZoo toolbox
|
|
5
5
|
License-Expression: MIT
|
|
6
6
|
Project-URL: Homepage, https://github.com/mcgillmotionlab/biomechzoo
|
|
@@ -37,6 +37,7 @@ See also http://www.github.com/mcgillmotionlab/biomechzoo or http://www.biomechz
|
|
|
37
37
|
### Installing a dev environment
|
|
38
38
|
conda create -n biomechzoo-dev python=3.11
|
|
39
39
|
conda activate biomechzoo-dev
|
|
40
|
+
cd biomechzoo root folder
|
|
40
41
|
pip install -e ".[dev]"
|
|
41
42
|
|
|
42
43
|
### import issues
|
|
@@ -22,9 +22,9 @@ src/biomechzoo/biomech_ops/phase_angle_data.py
|
|
|
22
22
|
src/biomechzoo/biomech_ops/phase_angle_line.py
|
|
23
23
|
src/biomechzoo/conversion/__init__.py
|
|
24
24
|
src/biomechzoo/conversion/c3d2zoo_data.py
|
|
25
|
-
src/biomechzoo/conversion/csv2zoo_data.py
|
|
26
25
|
src/biomechzoo/conversion/mvnx2zoo_data.py
|
|
27
26
|
src/biomechzoo/conversion/opencap2zoo_data.py
|
|
27
|
+
src/biomechzoo/conversion/table2zoo_data.py
|
|
28
28
|
src/biomechzoo/mvn/__init__.py
|
|
29
29
|
src/biomechzoo/mvn/load_mvnx.py
|
|
30
30
|
src/biomechzoo/mvn/main_mvnx.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/biomech_ops/continuous_relative_phase_data.py
RENAMED
|
File without changes
|
{biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/biomech_ops/continuous_relative_phase_line.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/processing/split_trial_by_gait_cycle.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{biomechzoo-0.4.8 → biomechzoo-0.4.10}/src/biomechzoo/utils/compute_sampling_rate_from_time.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|