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

Speed up and improve sleeplog handling #1244

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

vincentvanhees
Copy link
Member

@vincentvanhees vincentvanhees commented Jan 4, 2025

Fixes #1243 by:

  • Making date recognition in g.loadlog more robust by:
    • first trying date format that was successful in previous row of sleeplog instead of going through a standard set of date formats for each row.
    • testing the date format correctness not only for first date per row but first 5 dates per row.
    • add warnings when there are more than 300 missing dates or start date of log and accelerometer differ by more than 300 days.
  • speeds up sleeplog processing in part4 by:
    • avoiding vector length expansion with every iteration of the loop
    • skipping the processing entirely if the sleeplog if the last date of sleeplog change is after the last data of change to the sleeplog.RData file generated by GGIR. this means that if the sleeplog has not changed there is no need to reprocess it.

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).
  • Clean code has been attempted, e.g. intuitive object names and no code redundancy.
  • Documentation updated:
    • Function documentation
    • Chapter vignettes for GitHub IO
    • Vignettes for CRAN
  • Corresponding issue tagged in PR message. If no issue exist, please create an issue and tag it.
  • 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.
  • GGIR parameters were added/removed. If yes, please also complete checklist below.

@vincentvanhees vincentvanhees marked this pull request as ready for review January 4, 2025 11:29
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.

Speeding up and making date format recognition more robust in function g.loadlog
1 participant