Skip to content

Commit 6300eec

Browse files
Update dependency, adding permissions (#244)
* Update dependency, adding permissions * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update test.yaml * Add action commit hash * Update min actfast version * Update pyproject.toml bump min version of scipy * Update poetry.lock * Update test.yaml Try moving this up * Update pyproject.toml Move to numpy > 2.1.0? * Update poetry.lock * Bump scikit learn * More scikit bump * Bump min actfast to newest * Update test.yaml Fix permission level * Initial test of nimbledetach failing mypy and ruff but just checking python tests cross platform * Minor fixes * Pandas added back in * Fixing some ruff/mypy issues * Update nimbaldetach.py Moved to private function outside nimbaldetach * Starting refactor * Fixing return * Update poetry.lock * Update test.yaml Add 3.13 back * refactor intermediary steps * Update _nimbaldetach.py * Update test.yaml Should no longer be needed due to removing skdh dependency * Update README.md Remove libomp warning * Update _nimbaldetach.py change function name * Update _nimbaldetach.py Fixing some docstrings * Remove pandas --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent b752d9a commit 6300eec

6 files changed

Lines changed: 335 additions & 1225 deletions

File tree

.github/workflows/test.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,27 @@ on:
99
- main
1010
pull_request:
1111

12+
1213
jobs:
1314
unit:
1415
runs-on: ${{ matrix.os }}
16+
1517
strategy:
1618
fail-fast: false
1719
matrix:
1820
os: [ubuntu-latest, windows-latest, macos-latest]
19-
python_version: ['3.10', '3.11', '3.12']
21+
python_version: ['3.10', '3.11', '3.12', '3.13']
2022
resolution: [lowest-direct, highest]
2123
steps:
2224
- uses: actions/checkout@v4
2325
- name: Install poetry
2426
run: pipx install poetry
27+
2528
- uses: actions/setup-python@v5
2629
with:
2730
python-version: ${{ matrix.python_version }}
2831
cache: pip
2932

30-
- name: Install dependencies on macOS
31-
if: runner.os == 'macOS'
32-
run: |
33-
brew install libomp gfortran
34-
3533
- name: Install dependencies
3634
run: |
3735
poetry env use python

README.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,14 @@ The main processing pipeline of the wristpy module can be described as follows:
3535
- **Data calibration**: A post-manufacturer calibration step can be applied, to ensure that the acceleration sensor is measuring 1*g* force during periods of no motion. There are three possible options: `None`, `gradient`, `ggir`.
3636
- ***Data imputation*** In the special case when dealing with the Actigraph `idle_sleep_mode == enabled`, the gaps in acceleration are filled in after calibration, to avoid biasing the calibration phase.
3737
- **Metrics Calculation**: Calculates various activity metrics on the calibrated data, namely ENMO (Euclidean norm, minus one), MAD (mean amplitude deviation) <sup>1</sup>, Actigraph activity counts<sup>2</sup>, MIMS (monitor-independent movement summary) unit <sup>3</sup>, and angle-Z (angle of acceleration relative to the *x-y* axis).
38-
- **Non-wear detection**: We find periods of non-wear based on the acceleration data. Specifically, the standard deviation of the acceleration values in a given time window, along each axis, is used as a threshold to decide `wear` or `not wear`. Additionally, we can use the temperature sensor, when avaialable, to augment the acceleration data. This is used in the CTA (combined temperature and acceleration) algorithm <sup>4</sup>, and in the `skdh` DETACH algorithm <sup>5</sup>. Furthermore, ensemble classification of non-wear periods is possible by providing a list (of any length) of non-wear algorithm options.
38+
- **Non-wear detection**: We find periods of non-wear based on the acceleration data. Specifically, the standard deviation of the acceleration values in a given time window, along each axis, is used as a threshold to decide `wear` or `not wear`. Additionally, we can use the temperature sensor, when avaialable, to augment the acceleration data. This is used in the CTA (combined temperature and acceleration) algorithm <sup>4</sup>, and in the DETACH algorithm <sup>5</sup>. Furthermore, ensemble classification of non-wear periods is possible by providing a list (of any length) of non-wear algorithm options.
3939
- **Sleep Detection**: Using the HDCZ<sup>6</sup> and HSPT<sup>7</sup> algorithms to analyze changes in arm angle we are able to find periods of sleep. We find the sleep onset-wakeup times for all sleep windows detected. Any sleep periods that overlap with detected non-wear times are removed, and any remaining sleep periods shorter than 15 minutes (default value) are removed. Additionally, the SIB (sustained inactivity bouts) and the SPT (sleep period time) windows are provided as part of the output to aid in sleep metric post-processing.
4040
- **Physical activity levels**: Using the chosen physical activity metric (aggregated into time bins, 5 second default) we compute activity levels into the following categories: [`inactive`, `light`, `moderate`, `vigorous`]. The threshold values can be defined by the user, while the default values are chosen based on the specific activity metric and the values found in the literature <sup>8-10</sup>.
4141
- **Data output**: The output results can be saved in `.csv` or `.parquet` data formats, with the run-time configuration parameters saved in a `.json` dictionary.
4242

4343

4444
## Installation
4545

46-
> ### ⚠️ Important Note for macOS Users
47-
>
48-
> **wristpy** depends on `libomp`, a system-level dependency that is not always installed by default on macOS. Install it via:
49-
>
50-
> ```bash
51-
> brew install libomp
52-
> ```
53-
54-
5546
Install the `wristpy` package from PyPI via:
5647

5748
```sh

0 commit comments

Comments
 (0)