Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sleep timestamps #71

Merged
merged 8 commits into from
Jan 30, 2024
Merged

Sleep timestamps #71

merged 8 commits into from
Jan 30, 2024

Conversation

Vaeliss
Copy link
Collaborator

@Vaeliss Vaeliss commented Jan 30, 2024

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:

  • 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.

@dado93 dado93 changed the base branch from main to 0.1.x January 30, 2024 11:14
@dado93 dado93 merged commit 69cb74b into 0.1.x Jan 30, 2024
@dado93 dado93 deleted the sleep-timestamps branch January 30, 2024 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants