60 : CPD implementation still follows the main guidelines in the original paper and the chronotype is computed over all available data, if not specified. If a single day is used for the computation a warning is raised. Note that if chronotype is not specified even in this case the CPD metric will obviously be 0, as the sleep occurrence is compared only with itself.
65: There's differences in the implementation w.r.t. the original proposed solutions for the issue:
the sleep.get_sleep_timestamps function is to be used only when asking for the sleep timestamps for each day, not for aggregate measures. It returns, in that case, the same expected output as in previous versions.
the dictionary of the mapping is defined as a global variable in the module, and it has to be used to specify different behavior from what's commonly expected for functions given to the kind parameter for the sleep.get_sleep_statistic and sleep.get_sleep_statistics functions. Note that default behavior is reported in the mapping through the "default" key.
With respect to internal discussions had, the application of the kind function for sleep.get_sleep_statistics is done explicitely per column in the user_sleep_metrics_df, as opposed to using pandas built-in functions (like pandas.Dataframe.agg), as these appeared to be problematic when used with user-defined functions.
Some comments w.r.t. the issues this closes:
60 : CPD implementation still follows the main guidelines in the original paper and the chronotype is computed over all available data, if not specified. If a single day is used for the computation a warning is raised. Note that if chronotype is not specified even in this case the CPD metric will obviously be 0, as the sleep occurrence is compared only with itself.
65: There's differences in the implementation w.r.t. the original proposed solutions for the issue:
sleep.get_sleep_timestamps
function is to be used only when asking for the sleep timestamps for each day, not for aggregate measures. It returns, in that case, the same expected output as in previous versions.kind
parameter for thesleep.get_sleep_statistic
andsleep.get_sleep_statistics
functions. Note that default behavior is reported in the mapping through the "default" key.sleep.get_sleep_statistics
is done explicitely per column in theuser_sleep_metrics_df
, as opposed to using pandas built-in functions (likepandas.Dataframe.agg
), as these appeared to be problematic when used with user-defined functions.