Skip to content

Commit f3485a1

Browse files
authored
Release v1.1.0 (#255)
* Merge dev branch into release
1 parent 54db93f commit f3485a1

74 files changed

Lines changed: 10349 additions & 3799 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11
* text=auto
2-
IMU_segment0001_meta.json filter=lfs diff=lfs merge=lfs -text
3-
IMU_segment0001_time.bin filter=lfs diff=lfs merge=lfs -text
4-
IMU_segment0001_values.bin filter=lfs diff=lfs merge=lfs -text
5-
IMU_segment0002_meta.json filter=lfs diff=lfs merge=lfs -text
6-
IMU_segment0002_time.bin filter=lfs diff=lfs merge=lfs -text
7-
IMU_segment0002_values.bin filter=lfs diff=lfs merge=lfs -text
8-
PPG_segment0001_meta.json filter=lfs diff=lfs merge=lfs -text
9-
PPG_segment0001_time.bin filter=lfs diff=lfs merge=lfs -text
10-
PPG_segment0001_values.bin filter=lfs diff=lfs merge=lfs -text
11-
PPG_segment0002_meta.json filter=lfs diff=lfs merge=lfs -text
12-
PPG_segment0002_time.bin filter=lfs diff=lfs merge=lfs -text
13-
PPG_segment0002_values.bin filter=lfs diff=lfs merge=lfs -text
2+
test_file.parquet filter=lfs diff=lfs merge=lfs -text
3+
example_data/**/*_time.bin filter=lfs diff=lfs merge=lfs -text
4+
example_data/**/*_values.bin filter=lfs diff=lfs merge=lfs -text
5+
example_data/**/*_meta.json filter=lfs diff=lfs merge=lfs -text
146

157
# Normalize line endings
168
*.py text eol=lf

.github/workflows/build-and-test.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ jobs:
5555
- name: Run pytest
5656
run: poetry run pytest --maxfail=1 --disable-warnings -q
5757

58-
# Static type checks
59-
- name: Type check with pytype
60-
run: poetry run pytype .
61-
6258
# Build the package
6359
- name: Build package
6460
run: poetry build

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,5 +116,18 @@ celerybeat.pid
116116
*.spec
117117
*.sage.py
118118
*.asv
119+
119120
pip-log.txt
120121
pip-delete-this-directory.txt
122+
123+
# =========================
124+
# Logs and databases
125+
# =========================
126+
*.log
127+
output*/
128+
129+
# =========================
130+
# Generated TSDF files (from running notebooks/tests)
131+
# =========================
132+
example_data/**/segment*.json
133+
example_data/**/segment*.bin

.pre-commit-config.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,6 @@ repos:
1919
pass_filenames: true
2020
types: [python]
2121

22-
- repo: https://github.com/PyCQA/isort
23-
rev: 6.1.0
24-
hooks:
25-
- id: isort
26-
args: ["--profile", "black"]
27-
types: [python]
28-
2922
- repo: https://github.com/astral-sh/ruff-pre-commit
3023
rev: v0.14.0
3124
hooks:

CHANGELOG.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,49 @@
22

33
<!--next-version-placeholder-->
44

5+
## v1.1.0 (04/02/2026)
6+
7+
### Features
8+
- **Orchestrator Pipeline**: Added `orchestrator.py` with `run_paradigma()` function for complete end-to-end ParaDigMa analysis pipeline from data loading to aggregated results.
9+
- **Data Preparation**: Added `prepare_data.py` with automatic data preparation capabilities, including column mapping for flexible column names, watch orientation adjustment, and comprehensive validation.
10+
- **Centralized Loading**: Added `load.py` to centralize data loading capabilities across all pipelines.
11+
- **High-Level Pipeline Functions**: Added `run_gait_pipeline()`, `run_tremor_pipeline()`, and `run_pulse_rate_pipeline()` for simplified pipeline execution.
12+
- **Segment Distinction**: Added `GAIT_SEGMENT_NR` and `DATA_SEGMENT_NR` constants to distinguish between temporal gaps and gait bouts. `SEGMENT_NR` kept as deprecated alias for backward compatibility.
13+
- **Test Data**: Added Physilog Gait-Up test data to LFS.
14+
15+
### Improvements
16+
- **Logging System**: Replaced `verbose` parameter with standard Python logging using `logging_level` and `custom_logger` parameters across all pipeline functions for better control and traceability.
17+
- **Data Segment Preservation**: Modified `quantify_arm_swing()` to preserve `data_segment_nr` when present in input data.
18+
- **Bug Fixes**: Fixed NaN propagation in resampling by interpolating NaN values before resampling (scipy cannot handle NaN in non-contiguous data).
19+
20+
### Documentation
21+
- **New Tutorials**: Added `pipeline_orchestrator.ipynb` tutorial demonstrating end-to-end processing with logging control examples.
22+
- **New Guides**: Added comprehensive guides for data_input, installation, sensor_requirements, supported_devices, and validation.
23+
- **Readme**: Shortened README.md for readability and expanded detailed guides.
24+
- **PEP Standards**: Updated all docstrings and function signatures to PEP standards.
25+
- **Build System**: Added single-notebook build support with `--notebook` argument; automated style tag removal in documentation build pipeline.
26+
27+
### Testing
28+
- Added minimal testing for new pipeline functionalities.
29+
- Added tests for segment column naming and backward compatibility.
30+
- Added tests to verify data segment tracking preservation.
31+
32+
### Backward Compatibility
33+
- All existing code using `SEGMENT_NR` continues to work.
34+
- Previously used pipeline code remains functional.
35+
36+
## v1.0.4 (11/11/2025)
37+
- Column names no longer have to be set to ParaDigMa standards, but can be flexibly adjusted (see data_preparation.ipynb tutorial for instructions).
38+
- Users can now change the tolerance threshold for determining when consecutive timestamps are contiguous using config.
39+
- The usage of accelerometry is now optional. Accelerometry can be used to detect motion artefacts that can be removed using Paradigma (see pulse_rate_analysis.ipynb for more details).
40+
- We also added instructions for how to scale PPG features using z-scoring.
41+
- Coefficient of variation (CoV) added as aggregation method for arm swing during gait.
42+
- Gait segment duration categories are no longer fixed.
43+
44+
For developers
45+
* We added pre-commit hooks to ensure consistency in formatting and automate cleanup.
46+
* We also created two Python scripts for simplifying building and hosting docs, using poetry build-docs and poetry serve-docs.
47+
548
## v1.0.3 (08/09/2025)
649
- Added flexibility to let user specify gait segment duration categories.
750
- Added the within-segment coefficient of variation to list of arm swing parameters.

CITATION.cff

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ message: >-
55
If you use this software, please cite it using the
66
metadata from this file.
77
type: software
8+
version: 1.1.0
9+
date-released: '2026-02-04'
810
authors:
911
- given-names: Erik
1012
family-names: Post
@@ -95,18 +97,19 @@ abstract: >-
9597
package designed for processing and analyzing real-life wrist sensor data to
9698
extract digital measures of motor and non-motor signs of Parkinson's disease (PD).
9799
98-
Specifically, the toolbox is designed to process accelerometer, gyroscope and
99-
photoplethysmography signals, collected during passive monitoring in daily life.
100-
It contains three data processing pipelines: (1) arm swing during gait, (2) tremor,
101-
and (3) pulse rate analysis. These pipelines are scientifically validated for their
102-
use in persons with PD. Furthermore, the toolbox contains general functionalities
103-
for signal processing and feature extraction, such as filtering, peak detection, and
104-
spectral analysis.
100+
The toolbox processes accelerometer, gyroscope and photoplethysmography signals
101+
collected during passive monitoring in daily life. It contains three scientifically
102+
validated data processing pipelines: (1) arm swing during gait, (2) tremor, and
103+
(3) pulse rate analysis. An orchestrator function enables end-to-end processing from
104+
raw data loading to aggregated measures, with automatic data preparation including
105+
flexible column mapping and sensor orientation adjustment. The toolbox also provides
106+
general functionalities for signal processing and feature extraction, such as
107+
filtering, peak detection, and spectral analysis.
105108
106-
The toolbox is accompanied by a set of example scripts and notebooks for each
107-
processing pipeline that demonstrate how to use the toolbox for extracting digital
108-
measures. In addition, the toolbox is designed to be modular, enabling researchers
109-
to easily extend the toolbox with new algorithms and functionalities.
109+
ParaDigMa is accompanied by comprehensive documentation including tutorials,
110+
installation guides, and API reference. The modular architecture enables researchers
111+
to easily extend the toolbox with custom algorithms and functionalities while
112+
maintaining compatibility with standardized data formats.
110113
111114
keywords:
112115
- parkinson's disease

CONTRIBUTING.md

Lines changed: 126 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,58 @@ Documentation contributions are always welcome! You can contribute to:
3232
* Docstrings: In Python modules
3333
* Articles or blog posts
3434

35+
#### Docstring Style Guide
36+
37+
ParaDigMa follows NumPy/Napoleon docstring conventions with these type annotation guidelines:
38+
39+
**Function Signatures:**
40+
- Use PEP 604 syntax: `str | Path` instead of `Union[str, Path]`
41+
- Use `X | None` instead of `Optional[X]`
42+
- Example:
43+
```python
44+
def load_data(
45+
path: str | Path,
46+
config: Config | None = None
47+
) -> pd.DataFrame:
48+
```
49+
50+
**Parameter Docstrings:**
51+
- Use natural language for types, not Python type syntax
52+
- For union types: `str or Path` not `Union[str, Path]`
53+
- For optional parameters: Add `, optional` suffix
54+
- For lists: `list of str` not `List[str]`
55+
- For dicts: `dict` not `Dict[str, int]`
56+
57+
**Examples:**
58+
```python
59+
def example_function(
60+
data_path: str | Path,
61+
columns: List[str] | None = None,
62+
config: Config | None = None,
63+
) -> pd.DataFrame:
64+
"""
65+
Load and process data.
66+
67+
Parameters
68+
----------
69+
data_path : str or Path
70+
Path to data directory
71+
columns : list of str, optional
72+
Column names to load
73+
config : Config, optional
74+
Configuration object
75+
76+
Returns
77+
-------
78+
pd.DataFrame
79+
Processed data
80+
"""
81+
```
82+
83+
**Return Type Documentation:**
84+
- Use simple descriptions: `dict` or `DataFrame` not `Dict[str, pd.DataFrame]`
85+
- Add details in the description text below
86+
3587
#### Workflow for notebooks and docs:
3688
1. Run and export notebooks:
3789

@@ -65,6 +117,41 @@ If you are proposing a feature:
65117
## Get Started!
66118

67119
Ready to contribute? Here's how to set up `paradigma` locally:
120+
121+
### Prerequisites
122+
123+
1. **Install git-lfs** (required for example data):
124+
125+
**Windows:**
126+
```bash
127+
choco install git-lfs
128+
# Or download from https://git-lfs.com/
129+
```
130+
131+
**Linux:**
132+
```bash
133+
# Ubuntu/Debian
134+
sudo apt-get install git-lfs
135+
136+
# Fedora/RHEL
137+
sudo dnf install git-lfs
138+
139+
# Arch Linux
140+
sudo pacman -S git-lfs
141+
```
142+
143+
**macOS:**
144+
```bash
145+
brew install git-lfs
146+
```
147+
148+
2. **Enable git-lfs:**
149+
```bash
150+
git lfs install
151+
```
152+
153+
### Clone and Install
154+
68155
1. Clone the repository:
69156

70157
```bash
@@ -78,13 +165,40 @@ cd paradigma
78165
poetry install
79166
```
80167

81-
3. Create a new branch for your work:
168+
3. **Verify example data setup:**
169+
170+
Check that example data was downloaded correctly (not git-lfs pointers):
171+
172+
**Linux/macOS:**
173+
```bash
174+
ls -lh example_data/verily/ppg/*.bin
175+
# Should show file sizes (100KB - several MB), not ~130 bytes
176+
177+
head -n 1 example_data/verily/ppg/PPG_segment0001_meta.json
178+
# Should show JSON like {"file_name": ..., not "version https://git-lfs.github.com/spec/v1"
179+
```
180+
181+
**Windows PowerShell:**
182+
```powershell
183+
Get-ChildItem example_data/verily/ppg/*.bin | Select-Object Name, Length
184+
# Should show file sizes (100KB - several MB), not ~130 bytes
185+
186+
Get-Content example_data/verily/ppg/PPG_segment0001_meta.json -Head 1
187+
# Should show JSON, not "version https://git-lfs.github.com/spec/v1"
188+
```
189+
190+
**If files are git-lfs pointers:**
191+
```bash
192+
git lfs pull
193+
```
194+
195+
4. Create a new branch for your work:
82196

83197
```bash
84198
git checkout -b name-of-your-bugfix-or-feature
85199
```
86200

87-
4. Make your changes and run the pre-commit hooks:
201+
5. Make your changes and run the pre-commit hooks:
88202

89203
```bash
90204
pip install pre-commit
@@ -93,16 +207,23 @@ pre-commit run --all-files
93207
```
94208

95209
This ensures code formatting (`black`), import sorting (`isort`), stripping notebook outputs, and other checks.
96-
These pre-commit hooks also run for changed and staged files when committing.
210+
These pre-commit hooks also run for changed files when committing.
97211

98-
5. If contributing to docs, build and serve them locally to verify:
212+
6. If contributing to docs, build and serve them locally to verify:
99213

100214
```bash
101215
poetry run build-docs
102216
poetry run serve-docs
103217
```
104218

105-
6. Commit your changes and open a pull request.
219+
`build-docs` accepts the following arguments to speed up development:
220+
- `--notebook <filename>` - Build only a specific notebook (e.g., `--notebook pipeline_orchestrator.ipynb`)
221+
- `--dev` - Skip execution of notebooks
222+
- `--no-nbconvert` - Skip conversion of notebooks to markdown
223+
224+
These options are useful when iterating on documentation changes without rebuilding everything.
225+
226+
7. Commit your changes and open a pull request.
106227

107228
## Pull Request Guidelines
108229

0 commit comments

Comments
 (0)