biomechzoo 0.4.8__py3-none-any.whl → 0.4.9__py3-none-any.whl
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/biomechzoo.py +6 -24
- biomechzoo/conversion/{csv2zoo_data.py → table2zoo_data.py} +5 -2
- {biomechzoo-0.4.8.dist-info → biomechzoo-0.4.9.dist-info}/METADATA +1 -1
- {biomechzoo-0.4.8.dist-info → biomechzoo-0.4.9.dist-info}/RECORD +8 -8
- {biomechzoo-0.4.8.dist-info → biomechzoo-0.4.9.dist-info}/WHEEL +0 -0
- {biomechzoo-0.4.8.dist-info → biomechzoo-0.4.9.dist-info}/entry_points.txt +0 -0
- {biomechzoo-0.4.8.dist-info → biomechzoo-0.4.9.dist-info}/licenses/LICENSE +0 -0
- {biomechzoo-0.4.8.dist-info → biomechzoo-0.4.9.dist-info}/top_level.txt +0 -0
biomechzoo/biomechzoo.py
CHANGED
|
@@ -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 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)
|
|
@@ -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)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
__init__.py,sha256=Uy3ykqw4l_lZKiUWSUFPRZpkZajYUfZLBaQLVhKzxdI,772
|
|
2
2
|
biomechzoo/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
3
|
biomechzoo/__main__.py,sha256=hSMHN1Rxn2367fSGTLHoOQ4_pocZw0IWI7HFxl-74oY,88
|
|
4
|
-
biomechzoo/biomechzoo.py,sha256=
|
|
4
|
+
biomechzoo/biomechzoo.py,sha256=gWTFroK4FGEu4Z43n1Bxpqao5rgtoQTsgVvR4BwoPcI,19785
|
|
5
5
|
biomechzoo/biomech_ops/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
biomechzoo/biomech_ops/continuous_relative_phase_data.py,sha256=RePbt6zyOI1iv74CWhxSrunIokTFYVfFmFnoW51781E,1300
|
|
7
7
|
biomechzoo/biomech_ops/continuous_relative_phase_line.py,sha256=Fa1LFRuPlmGPLQLvln6HVnJy3zMSm9z5YeooHmTu0lc,1365
|
|
@@ -13,9 +13,9 @@ biomechzoo/biomech_ops/phase_angle_data.py,sha256=_ekUBW2v3iC4UawcDL38ZZLYJmQsAm
|
|
|
13
13
|
biomechzoo/biomech_ops/phase_angle_line.py,sha256=p6osB17_3QQSyKLNojuc6nYhv-k0K6EUUH75EXu8ifc,1391
|
|
14
14
|
biomechzoo/conversion/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
15
|
biomechzoo/conversion/c3d2zoo_data.py,sha256=gnSCw99Hg5JLdrGezZNVZ6EHqiD6i-mpsLRtWmEa-Mg,2855
|
|
16
|
-
biomechzoo/conversion/csv2zoo_data.py,sha256=9FjlJjCSdT9d5n10Kc74hq5sXBmUdRA8CSIMWlPAk4o,3175
|
|
17
16
|
biomechzoo/conversion/mvnx2zoo_data.py,sha256=O6WuKe_5fZJfd1gUe3oP9rND_i5P4WGEuu2MDvI3ypY,3560
|
|
18
17
|
biomechzoo/conversion/opencap2zoo_data.py,sha256=n4bLsrJI0wTSzG5bgJcmxj1dp2plnUKFNRzcTIbmV1o,608
|
|
18
|
+
biomechzoo/conversion/table2zoo_data.py,sha256=OLiRlYB8GqOwv4MAlmwhIkGLxgAvmrgUjTb-Irev4lU,3297
|
|
19
19
|
biomechzoo/mvn/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
20
|
biomechzoo/mvn/load_mvnx.py,sha256=B4VGuidQ-5G_5E1t5vpU51Nb_Lu85_EOS_FmGZYjfX8,22499
|
|
21
21
|
biomechzoo/mvn/main_mvnx.py,sha256=e1LasJQ9icyzjWnRCEcAWQq_-L13-mIzf7PzYA3QYDg,2394
|
|
@@ -43,9 +43,9 @@ biomechzoo/utils/version.py,sha256=JIXDUuOcaJiZv9ruMP6PtWvJBh4sP0D5kAvlqPiZK_I,1
|
|
|
43
43
|
biomechzoo/utils/zload.py,sha256=FPT6_-gwaOOqOckjgPRfnKEVKMsmNVIcenmQZF2KOvo,1535
|
|
44
44
|
biomechzoo/utils/zplot.py,sha256=WVA8aCy1Pqy_bo_HXab9AmW-cBd8J8MPX2LAOd6dznU,1512
|
|
45
45
|
biomechzoo/utils/zsave.py,sha256=wnRNuDxQc8bwCji4UrfoGjYrSZmka4eaDxQ5rMa78pE,1759
|
|
46
|
-
biomechzoo-0.4.
|
|
47
|
-
biomechzoo-0.4.
|
|
48
|
-
biomechzoo-0.4.
|
|
49
|
-
biomechzoo-0.4.
|
|
50
|
-
biomechzoo-0.4.
|
|
51
|
-
biomechzoo-0.4.
|
|
46
|
+
biomechzoo-0.4.9.dist-info/licenses/LICENSE,sha256=Fsz62nrgRORre3A1wNXUDISaHoostodMvocRPDdXc9w,1076
|
|
47
|
+
biomechzoo-0.4.9.dist-info/METADATA,sha256=VVG2UyRLhjRchJAnMc80aqXLb-0oqCHZauXxntwDq-w,1553
|
|
48
|
+
biomechzoo-0.4.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
49
|
+
biomechzoo-0.4.9.dist-info/entry_points.txt,sha256=VdryUUiwwvx0WZxrgmMrsyfe5Z1jtyaxdXOi0zWHOqk,41
|
|
50
|
+
biomechzoo-0.4.9.dist-info/top_level.txt,sha256=nJEtuEZ9UPoN3EOR-BJ6myevEu7B5quWsWhaM_YeQpw,20
|
|
51
|
+
biomechzoo-0.4.9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|