Open dado93 opened 3 months ago
Yes, agreed, I would expand this also to stress
and activity
modules in the future too. Essentially, I’d extend it to any metric that we can obtain as a series and then compute aggregates over time.
Perhaps we should consider adding a cycle_type
parameter to any get_XX
function, rather than creating different versions of the function. This parameter could be set to "physiological"
(like WHOOP) or "solar_day"
(or something like that, i.e. midnight to midnight); we could also consider including the choices "day"
and "night"
for the same parameter (i.e. while awake, while asleep). Then we can have 4 functions in utils
that take as input any time series and filters / divides it based on the necessary logic (e.g. there's already utils.filter_out_awake
). Seems to me cleaner than having multiple versions of the same statistic as a function?
Also, it seems reasonable to me to say that if a physiological cycle is longer than 36 hours, instead of having a very long sleep cycle we assume solar day cycles for those days (i.e. stops and start at midnight). And "night" statistics would be NaT.
The statistics of the
cardiac
andrespiration
module are computed using as a timeframe the time that goes from midnight to midnight. It would be interesting to offer two different functions for each of the statistic:get_daily_XX
, computing the value of statistic XX from midnight to midnight (current behavior)get_cycle_XX
, computing the value of statistics XX from bedtime to the following bedtime (physiological cycle)Of course, in order to compute statistics on a physiological cycle level, we need to:
https://support.whoop.com/s/article/WHOOP-Cycles?language=en_US
What do you think @Vaeliss ?