Skip to content

feat: add options to enable/disable spurious sleep removal#272

Merged
chanshing merged 1 commit intomasterfrom
feat/remove-spurious-sleep
Jul 13, 2025
Merged

feat: add options to enable/disable spurious sleep removal#272
chanshing merged 1 commit intomasterfrom
feat/remove-spurious-sleep

Conversation

@chanshing
Copy link
Copy Markdown
Member

This pull request introduces functionality to remove spurious sleep periods from activity classification. It adds new parameters to control this behavior and updates the relevant functions to incorporate these changes. The primary focus is on improving the accuracy of activity classification by filtering out short, potentially erroneous sleep periods.

Enhancements to Activity Classification:

  • New Command-Line Arguments: Added --removeSpuriousSleep and --removeSpuriousSleepTol arguments to accProcess.py to enable and configure spurious sleep removal. The default behavior removes sleep periods shorter than 60 minutes. (src/accelerometer/accProcess.py, src/accelerometer/accProcess.pyR178-R186)
  • Updated activityClassification Function: Incorporated spuriousSleepRemoval and spuriousSleepTol parameters to conditionally apply spurious sleep removal during activity classification. (src/accelerometer/classification.py, [1] [2]

Improvements to Spurious Sleep Removal Logic:

  • Enhanced removeSpuriousSleep Function: Updated the sleepTol parameter to accept an integer representing minutes instead of a string duration, simplifying its usage. (src/accelerometer/classification.py, [1] [2]

Integration with Activity Summarization:

  • New Parameters in getActivitySummary: Added removeSpuriousSleep and removeSpuriousSleepTol parameters to allow spurious sleep removal during activity summary generation. These parameters are passed down to the activityClassification function. (src/accelerometer/summarisation.py, [1] [2] [3]

Codebase-Wide Updates:

  • Parameter Propagation: Ensured the new parameters are passed through all relevant functions, including deleteIntermediateFiles and getActivitySummary, to maintain consistency. (src/accelerometer/accProcess.py, [1]; src/accelerometer/summarisation.py, [2]

These changes collectively enhance the robustness of activity classification by addressing spurious sleep periods, improving the reliability of downstream analyses.

@chanshing chanshing merged commit fa09455 into master Jul 13, 2025
24 of 29 checks passed
@chanshing chanshing deleted the feat/remove-spurious-sleep branch July 13, 2025 18:31
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.

1 participant