Last active
July 14, 2020 18:59
-
-
Save LukasAdamowicz/b8481ef32e4beeb77c80f29f34c8045e to your computer and use it in GitHub Desktop.
Sample data loader for testing the v2 interface of Sit2StandPy with a dictionary
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import h5py | |
from importlib import resources # assuming python >= 3.7 is installed | |
def data_load_function(): | |
data = {'Sensors': {'Lumbar': {}}} | |
with resources.path('sit2standpy.data', 'sample.h5') as file_path: | |
with h5py.File(file_path, 'r') as h5: | |
data['Sensors']['Lumbar']['Accelerometer'] = h5['Sensors']['Lumbar']['Accelerometer'][()] | |
data['Sensors']['Lumbar']['Unix Time'] = h5['Sensors']['Lumbar']['Unix Time'][()] | |
return data | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment