Skip to content

Instantly share code, notes, and snippets.

@LukasAdamowicz
Last active July 14, 2020 18:59
Show Gist options
  • Save LukasAdamowicz/b8481ef32e4beeb77c80f29f34c8045e to your computer and use it in GitHub Desktop.
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
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