-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathpyproject.toml
More file actions
139 lines (125 loc) · 4.87 KB
/
Copy pathpyproject.toml
File metadata and controls
139 lines (125 loc) · 4.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "physioex"
dynamic = ["version"]
description = "A python package for explainable sleep staging via deep learning"
readme = {"file" = "README.md", "content-type" = "text/markdown"}
requires-python = ">=3.11"
authors = [
{ name = "Guido Gagliardi", email = "guido.gagliardi@phd.unipi.it" }
]
license = {text = "MIT"}
dependencies = [
"torch>=2.7.0",
"numpy>=1.26.0",
"pandas>=2.0.0",
"pyyaml>=6.0",
"matplotlib>=3.10.0",
"scikit_learn>=1.7.0",
"scipy>=1.16.0",
"huggingface_hub>=0.34.0",
"captum>=0.6.0",
"loguru>=0.7.0",
"pyedflib>=0.1.42",
"braindecode>=1.0.0",
"ml_dtypes>=0.5.0",
"einops>=0.7.0",
"tqdm>=4.65.0",
"rich>=13.0.0",
"psutil>=5.9.0",
"torchinfo>=1.8.0",
]
[project.optional-dependencies]
gpu-monitor = ["nvitop>=1.0.0"]
tracking = ["tensorboard>=2.14", "wandb>=0.16"]
# Heavyweight, feature-specific deps imported lazily; install only if needed.
foundation = ["transformers>=4.40.0"] # REVE encoder (physioex.models.reve)
datasets = ["mne>=1.6.0"] # HOMEPAP EDF fallback reader (data.datasets.hpap)
dev = ["ruff", "pytest", "pytest-cov", "black~=22.0"]
legacy = ["pytorch_lightning>=2.5.0", "lightning>=2.5.0", "torchmetrics>=1.8.0"]
explain = [
"zennit>=0.5.1", # LRP composites/canonizers (Zennit path) + BatchNorm merging; attention/RNN rules are built in
]
docs = [
"sphinx==8.1.3",
"pydata-sphinx-theme==0.16.1",
"myst-nb==1.2.0", # pulls in myst-parser
"sphinx-design==0.6.1",
"sphinx-copybutton==0.5.2",
"sphinxcontrib-mermaid==1.0.0",
# autodoc/autosummary/napoleon/intersphinx/viewcode ship with sphinx.
# sphinx-autoapi is the static-parsing fallback (not enabled by default).
]
[tool.hatch.version]
path = "physioex/__init__.py"
[tool.hatch.build.targets.wheel]
packages = ["physioex"]
# Runtime data files that must ship in the wheel (loaded via __file__ at import time).
[tool.hatch.build.targets.wheel.force-include]
"physioex/train/models/check_table.csv" = "physioex/train/models/check_table.csv"
"physioex/data/datasets/_splits/shhs.json" = "physioex/data/datasets/_splits/shhs.json"
[project.scripts]
train = "physioex.train.bin.train:train_script"
finetune = "physioex.train.bin.finetune:finetune_script"
test_model = "physioex.train.bin.test:test_script"
[project.urls]
Homepage = "https://github.com/guidogagl/physioex"
Documentation = "https://guidogagl.github.io/physioex"
Repository = "https://github.com/guidogagl/physioex"
Issues = "https://github.com/guidogagl/physioex/issues"
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "-ra --strict-markers --import-mode=importlib"
markers = [
"unit: fast, isolated unit test (default)",
"integration: exercises several components together",
"real_data: needs datasets on disk (skipped unless PHYSIOEX_TEST_REAL_DATA=1)",
"gpu: needs a CUDA GPU (skipped if unavailable)",
"hf: needs HuggingFace network/checkpoints (skipped unless PHYSIOEX_TEST_HF=1)",
"slow: long-running test",
]
filterwarnings = [
"ignore::DeprecationWarning:physioex.data.dataset",
"ignore::DeprecationWarning:physioex.data.datareader",
]
[tool.coverage.run]
source = ["physioex"]
branch = true
omit = [
"physioex/data/dataset.py", # legacy, deprecated
"physioex/data/datareader.py", # legacy, deprecated
"*/tests/*",
# ── Not exercisable in CPU-only CI (covered by gated/manual runs) ──
"physioex/train/multidevicetrainer.py", # DDP, needs multi-GPU
"physioex/train/bin/*", # CLI entry points (gated cli_workflows)
# Foundation-encoder internals need HuggingFace weights (@hf, run on bio-gpu).
# Their contract (class attrs, PIPELINE_PRESET, wrapper) is covered CPU-side.
"physioex/models/bendr.py",
"physioex/models/biot.py",
"physioex/models/cbramod.py",
"physioex/models/labram.py",
"physioex/models/neurolm.py",
"physioex/models/reve.py",
"physioex/models/sjepa.py",
"physioex/models/sleepfm.py",
"physioex/models/tfc.py",
"physioex/models/coresleep.py", # multimodal, no CPU forward path tested
"physioex/models/protosleepnet.py", # composite encoder, gated
"physioex/models/embed.py", # extract/probe pipelines need HF + disk
"physioex/models/pretrained.py", # checkpoint loading (gated)
"physioex/models/foundation_checkpoints.py", # downloads checkpoints
"physioex/models/foundation_datasets.py", # dataset registry, needs real roots
"physioex/models/foundation_channel_mapping.py", # exercised via @hf encoder builds
]
[tool.coverage.report]
show_missing = true
skip_covered = false
exclude_lines = [
"pragma: no cover",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"@(abc\\.)?abstractmethod",
]