childmindresearch / wristpy

https://childmindresearch.github.io/wristpy/
GNU Lesser General Public License v2.1
2 stars 1 forks source link

Draft Task: Handling empty sensor data from Actfast #27

Open Asanto32 opened 3 months ago

Asanto32 commented 3 months ago

Description

Currently, we raise a Value Error if the sensor data (measurement or time) is empty from Actfast. However, it is only acceleration that is a mandatory field for further analysis (enmo, angle z, sleep, physical activity metrics, etc.) This task is to built on the current architecture to handle these potentially empty Measurement fields

Tasks

Freeform Notes

@ReinderVosDeWael Perhaps we raise the value error only for acceleration? And if a general measurement we just give a user warning??

def validate_accelereation(cls, v)
if v.measurements.size == 0:
raise ValueError...

but we try to give a warning for general empty measurements??

def validate_measurements_not_empty...
if v.size == 0:
warn("this field is empty")
nx10 commented 3 months ago

You probably want to check len(data) == 0 first and then something like datetime[-1] - datetime[0] < minimum time interval to be able to process, right?

ReinderVosDeWael commented 5 days ago

For further discussion: an error seems to be the correct behavior, but do we want to allow for an option to ignore errors in sensors we don't strictly need?