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

Issue811 sleep efficiency #890

Merged
merged 6 commits into from
Sep 11, 2023
Merged

Issue811 sleep efficiency #890

merged 6 commits into from
Sep 11, 2023

Conversation

jhmigueles
Copy link
Collaborator

@jhmigueles jhmigueles commented Sep 4, 2023

Closes #811 => added new parameter relyonguider_SleepEfficiency to handle how to calculate sleep efficiency in part 4 (note this is not applied in part 5 where sleep efficiency would always be sleep time / spt). If relyonguider_SleepEfficiency = FALSE (default), then the algorithm do NOT use the user-provided wake up time and the denominator is spt+latency (as proposed here). If relyonguider_SleepEfficiency = TRUE, then the denominator is the guider_spt as in previous GGIR versions.

Checklist before merging:

  • Existing tests still work (check by running the test suite, e.g. from RStudio).
  • Added tests (if you added functionality) or fixed existing test (if you fixed a bug).
  • Updated or expanded the documentation.
  • Updated release notes in inst/NEWS.Rd with a user-readable summary. Please, include references to relevant issues or PR discussions.
  • Added your name to the contributors lists in the DESCRIPTION and CITATION.cff files.

@codecov-commenter
Copy link

codecov-commenter commented Sep 4, 2023

Codecov Report

Merging #890 (f4636fa) into master (36dd97b) will increase coverage by 0.01%.
The diff coverage is 100.00%.

❗ Current head f4636fa differs from pull request most recent head f334e58. Consider uploading reports for the commit f334e58 to get more accurate results

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

@@            Coverage Diff             @@
##           master     #890      +/-   ##
==========================================
+ Coverage   78.12%   78.13%   +0.01%     
==========================================
  Files          91       91              
  Lines       12094    12097       +3     
==========================================
+ Hits         9448     9452       +4     
+ Misses       2646     2645       -1     
Files Changed Coverage Δ
R/check_params.R 97.61% <100.00%> (ø)
R/g.part4.R 80.35% <100.00%> (+0.23%) ⬆️
R/load_params.R 99.12% <100.00%> (ø)

R/g.part4.R Outdated
# calculate: sleep latency:
nightsummary[sumi, 25] = round(nightsummary[sumi, 3] - nightsummary[sumi, 7],
digits = 7) #sleeponset - guider_onset
# sleep efficiency:
nightsummary[sumi, 26] = round(nightsummary[sumi, 14]/nightsummary[sumi, 9], digits = 5) #accumulated nocturnal sleep / guider
if (params_sleep[["relyonguider_SleepEfficiency"]]) {
Copy link
Member

@vincentvanhees vincentvanhees Sep 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The term "relyonguider_SleepEfficiency" feels inaccurate because for the beginning of the night we will rely on guider (sleeplog) for latency estimates in both scenarios. For the end of the night we will fully rely on guider in the existing method and rely partially in the new method because the guider is used to identify wakeup time.

So, I think the distinction is not to rely on guider or not. Instead, maybe use sleepefficiency.metric with numbers 1, 2,... to indicate how it is calculated?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Further, changelog version needs to refer to version 2.10-3 as 2.10-2 is already out.

@vincentvanhees vincentvanhees merged commit 6f7f8bb into master Sep 11, 2023
8 checks passed
@vincentvanhees vincentvanhees deleted the issue811_sleepEfficiency branch February 28, 2024 08:53
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.

Improve definition of sleep efficiency in part 4
3 participants