Skip to content

Instantly share code, notes, and snippets.

View LukasAdamowicz's full-sized avatar

Lukas Adamowicz LukasAdamowicz

View GitHub Profile
@LukasAdamowicz
LukasAdamowicz / load_sample_s2spy_data.py
Last active July 14, 2020 18:59
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'][()]