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

Fix issue with handling of missing nights at the start of the recording in part 5 MM analysis #1045

Merged
merged 18 commits into from
Feb 28, 2024

Conversation

vincentvanhees
Copy link
Member

@vincentvanhees vincentvanhees commented Feb 14, 2024

Fixes #1039

This PR:

  • simplifies subfunction qwindow2timestamp to be just about converting numeric to timestamps without the complexity of epoch corrections.
  • deals with 24:00:00 not existing separately in one place
  • catches when first midnight is not within 24 hours of the recording start, and then assigns qqq[1] to the first midnight minus 24 hours.
  • subfunction name fixTime renamed to be more readable

@jhmigueles it may be best if you could review this PR, because this relates to code we both have worked on.

EDIT: I forgot to mention that my understanding is now that this problem was specific to multiple days of nonwear at the start of the recording. If we have a recording where days in the middle are invalid then there should not be a problem for this part of the code. But it may be good if you could also check that this observation is correct.

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 file, if you think you made a significant contribution.

- simplifies qwindow2timestamp to be just a numeric to timestamp conversion without epoch corrections.
- catches when first midnight is not within 24 hours of the recording start, and then assigns qqq[1] to the first midnight minus 24 hours.
- deals with 24:00:00 not existing outside the function in one place
- rename function name fixTime to be more intuitive
@vincentvanhees vincentvanhees marked this pull request as ready for review February 14, 2024 16:51
@vincentvanhees vincentvanhees merged commit 8de6e06 into master Feb 28, 2024
10 checks passed
@vincentvanhees vincentvanhees deleted the issue1039_fullQqq_error branch February 28, 2024 08:48
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.

g.part5.definedays warning: "number of items to replace is not a multiple of replacement length"
2 participants