Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.