Skip to content

Commit 8780d7c

Browse files
authored
ENH: Improve docs navigation and add demo data CLI (#56)
* ENH: Move clinical disclaimer box on webpage Floating box was obscuring text. Now disclaimer is integrated with main text on top-level page. * ENH: Link to BYOD Tutorials and include version info in top-level page * ENH: Clarify how to download demo data * ENH: Updated docs to use variable for version number
1 parent 159031a commit 8780d7c

22 files changed

Lines changed: 459 additions & 126 deletions

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,6 @@ tests/data/
4848
tests/results/
4949
tests/baseline_staging/
5050
test_output.txt
51+
52+
# docs
53+
docs_buildhtml

AGENTS.md

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -42,43 +42,51 @@ Non-Python tools used by contributor workflows:
4242

4343
## Common Commands
4444

45-
Use `py` on this Windows system, not `python`.
45+
Prefer the repository-local virtual environment at `.\venv`. Activate it before
46+
issuing Python commands so `python`, console scripts, and `uv pip` all use that
47+
environment. If activation is not possible, invoke
48+
`.\venv\Scripts\python.exe -m ...` directly. Use `uv run ...` only when the
49+
local `venv` is unavailable and you need uv to create or sync an environment.
50+
51+
```powershell
52+
# Create the repo-local environment if it does not already exist
53+
uv venv venv
54+
.\venv\Scripts\Activate.ps1
4655
47-
```bash
4856
# Install in editable mode
4957
uv pip install -e .
5058
5159
# Lint and format
52-
ruff check . --fix && ruff format .
60+
python -m ruff check . --fix && python -m ruff format .
5361
5462
# Type checking
55-
mypy src/ tests/
63+
python -m mypy src/ tests/
5664
5765
# All pre-commit hooks
58-
pre-commit run --all-files
66+
python -m pre_commit run --all-files
5967
6068
# Fast tests
61-
py -m pytest tests/ -v
69+
python -m pytest tests/ -v
6270
6371
# Single test file or test by name
64-
py -m pytest tests/test_contour_tools.py -v
65-
py -m pytest tests/test_contour_tools.py::test_extract_surface -v
72+
python -m pytest tests/test_contour_tools.py -v
73+
python -m pytest tests/test_contour_tools.py::test_extract_surface -v
6674
6775
# Opt-in test buckets
68-
py -m pytest tests/ -v --run-slow
69-
py -m pytest tests/ -v --run-gpu
70-
py -m pytest tests/ -v --run-simpleware
71-
py -m pytest tests/ -v --run-experiments
72-
py -m pytest tests/ -v --run-tutorials
76+
python -m pytest tests/ -v --run-slow
77+
python -m pytest tests/ -v --run-gpu
78+
python -m pytest tests/ -v --run-simpleware
79+
python -m pytest tests/ -v --run-experiments
80+
python -m pytest tests/ -v --run-tutorials
7381
7482
# Typical local GPU profile
75-
py -m pytest tests/ -v --run-gpu --run-slow
83+
python -m pytest tests/ -v --run-gpu --run-slow
7684
7785
# Coverage
78-
py -m pytest tests/ --cov=src/physiomotion4d --cov-report=html
86+
python -m pytest tests/ --cov=src/physiomotion4d --cov-report=html
7987
8088
# Create missing baselines
81-
py -m pytest tests/ --create-baselines
89+
python -m pytest tests/ --create-baselines
8290
```
8391

8492
Version bumping: `bumpver update --patch`, `--minor`, or `--major`.
@@ -95,7 +103,8 @@ Version bumping: `bumpver update --patch`, `--minor`, or `--major`.
95103
below 88 characters.
96104
- Full type hints are required under strict mypy. Use `Optional[X]`, not
97105
`X | None`.
98-
- Run `py -m pytest tests/ -v` to verify changes. Slow, GPU, Simpleware,
106+
- Run `python -m pytest tests/ -v` from the active `.\venv` to verify changes.
107+
Slow, GPU, Simpleware,
99108
experiment, and tutorial tests are auto-skipped unless their opt-in flag is
100109
passed.
101110
- The `requires_data` marker no longer exists. Tests that need external data
@@ -172,8 +181,8 @@ Version bumping: `bumpver update --patch`, `--minor`, or `--major`.
172181
- Update docstrings for every changed public method. Keep claims factual.
173182
- Document with docstrings and inline comments.
174183
- Do not create new `.md` files unless explicitly requested.
175-
- Regenerate `docs/API_MAP.md` after any public API change:
176-
`py utils/generate_api_map.py`.
184+
- Regenerate `docs/API_MAP.md` after any public API change from the active
185+
`.\venv`: `python utils/generate_api_map.py`.
177186

178187
## Architecture Role
179188

docs/API_MAP.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ _Re-run `py utils/generate_api_map.py` whenever public APIs change._
55

66
## docs/conf.py
77

8-
- **class Mock** (line 20)
9-
- `def autodoc_skip_member(app, what, name, obj, skip, options)` (line 222): Custom function to skip certain members during autodoc processing.
10-
- `def setup(app)` (line 230): Custom setup function for Sphinx.
8+
- **class Mock** (line 22)
9+
- `def autodoc_skip_member(app, what, name, obj, skip, options)` (line 227): Custom function to skip certain members during autodoc processing.
10+
- `def setup(app)` (line 239): Custom setup function for Sphinx.
1111

1212
## experiments/Colormap-VTK_To_USD/colormap_vtk_to_usd.py
1313

@@ -428,6 +428,10 @@ _Re-run `py utils/generate_api_map.py` whenever public APIs change._
428428

429429
- `def main()` (line 19): Command-line interface for create statistical model workflow.
430430

431+
## src/physiomotion4d/cli/download_data.py
432+
433+
- `def main(argv=None)` (line 16): Download a supported PhysioMotion4D example dataset.
434+
431435
## src/physiomotion4d/cli/fit_statistical_model_to_patient.py
432436

433437
- `def main()` (line 17): Command-line interface for heart model to patient registration.
@@ -870,7 +874,7 @@ _Re-run `py utils/generate_api_map.py` whenever public APIs change._
870874

871875
## tests/test_cli_smoke.py
872876

873-
- `def test_cli_help(module_name, monkeypatch, capsys)` (line 24): Each CLI module exits successfully for --help.
877+
- `def test_cli_help(module_name, monkeypatch, capsys)` (line 25): Each CLI module exits successfully for --help.
874878

875879
## tests/test_contour_tools.py
876880

@@ -916,6 +920,11 @@ _Re-run `py utils/generate_api_map.py` whenever public APIs change._
916920
- `def test_mask_ids_missing_boundary_labels_falls_back(self, tmp_path)` (line 562): Mesh without boundary_labels array falls back to a 'default' prim.
917921
- `def test_mask_ids_groups_by_segmenter_type(self, tmp_path)` (line 577): When a segmenter is supplied, labels are grouped under their
918922

923+
## tests/test_download_data_cli.py
924+
925+
- `def test_download_data_cli_uses_default_dataset_and_directory(monkeypatch, capsys)` (line 14): Default CLI arguments route Slicer-Heart-CT to data/Slicer-Heart-CT.
926+
- `def test_download_data_cli_uses_requested_directory(monkeypatch, tmp_path)` (line 34): The --directory option controls where Slicer-Heart-CT is stored.
927+
919928
## tests/test_download_heart_data.py
920929

921930
- **class TestDataDownloadTools** (line 16): Synthetic tests for dataset verification helpers.

docs/_static/custom.css

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,13 +268,21 @@ dt.sig {
268268
line-height: 1.08;
269269
}
270270

271-
.pm4d-hero p:not(.pm4d-kicker) {
271+
.pm4d-hero p:not(.pm4d-kicker):not(.pm4d-hero__version) {
272272
max-width: 760px;
273273
margin: 0;
274274
color: #d8dde6;
275275
font-size: 1.1rem;
276276
}
277277

278+
.pm4d-hero p.pm4d-hero__version {
279+
max-width: 760px;
280+
margin: 1.9rem 0 0;
281+
color: #ffffff;
282+
font-size: 0.78rem;
283+
font-weight: 700;
284+
}
285+
278286
.pm4d-card-grid {
279287
display: grid;
280288
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));

docs/api/cli/download_data.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
===================
2+
download_data (CLI)
3+
===================
4+
5+
.. automodule:: physiomotion4d.cli.download_data
6+
:members:
7+
:undoc-members:
8+
:show-inheritance:
9+
10+
See :doc:`../../cli_scripts/download_data` for usage examples.

docs/api/cli/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Module Index.
2222
convert_image_to_vtk
2323
convert_vtk_to_usd
2424
create_statistical_model
25+
download_data
2526
fit_statistical_model_to_patient
2627
reconstruct_highres_4d_ct
2728
visualize_pca_modes

docs/architecture.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ configuration.
99

1010
.. warning::
1111

12-
PhysioMotion4D 2026.05.07 beta is not validated for clinical use. It is a
13-
research and visualization toolkit, not a medical device.
12+
PhysioMotion4D {{ pm4d_project_version }} beta is not validated for clinical
13+
use. It is a research and visualization toolkit, not a medical device.
1414

1515
Data Flow
1616
=========

docs/cli_scripts/best_practices.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ Ensuring Reproducible Results
242242
243243
# processing_metadata.yaml
244244
patient_id: patient_001
245-
physiomotion4d_version: 2026.05.07
245+
physiomotion4d_version: {{ pm4d_project_version }}
246246
script: heart-gated-ct
247247
date: 2026-01-08
248248

0 commit comments

Comments
 (0)