rename: tea-modulo / tea_modulo -> tea (distribution, package, entry-point groups, MLflow names, image paths)
This commit is contained in:
@@ -1,14 +1,14 @@
|
|||||||
# tea_modulo
|
# tea
|
||||||
|
|
||||||
EEG library for the TEA project: EDF in; validation, preprocessing, processes
|
EEG library for the TEA project: EDF in; validation, preprocessing, processes
|
||||||
and biomarkers out. Every biomarker and every process is its own module, and
|
and biomarkers out. Every biomarker and every process is its own module, and
|
||||||
modules talk only through `tea_modulo.contracts`, so any module can be replaced
|
modules talk only through `tea.contracts`, so any module can be replaced
|
||||||
without touching the others. Architecture plan:
|
without touching the others. Architecture plan:
|
||||||
https://claude.ai/artifact/H9Rh19Lv79dVeikeVD9KFZ
|
https://claude.ai/artifact/H9Rh19Lv79dVeikeVD9KFZ
|
||||||
|
|
||||||
## Two implementations
|
## Two implementations
|
||||||
|
|
||||||
| | `tea_modulo` (modern) | `tea_modulo.legacy` |
|
| | `tea` (modern) | `tea.legacy` |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| Code | the director's methods on MNE, SciPy, scikit-learn, antropy, fooof, meegkit | the director's code (biomarcadores-tea @ 7dfc641, codigo @ c7a4736) copied unchanged except imports |
|
| Code | the director's methods on MNE, SciPy, scikit-learn, antropy, fooof, meegkit | the director's code (biomarcadores-tea @ 7dfc641, codigo @ c7a4736) copied unchanged except imports |
|
||||||
| Batches | Dask (`cluster="auto"/"remote"/"local"/"sync"`) | plain single-threaded loop |
|
| Batches | Dask (`cluster="auto"/"remote"/"local"/"sync"`) | plain single-threaded loop |
|
||||||
@@ -37,11 +37,11 @@ https://claude.ai/artifact/H9Rh19Lv79dVeikeVD9KFZ
|
|||||||
## Use
|
## Use
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from tea_modulo.validation import validate
|
from tea.validation import validate
|
||||||
bundle, valid = validate("study.edf") # R4B FHIR Bundle, 1 valid / 0 not valid
|
bundle, valid = validate("study.edf") # R4B FHIR Bundle, 1 valid / 0 not valid
|
||||||
|
|
||||||
from tea_modulo.pipeline import Pipeline
|
from tea.pipeline import Pipeline
|
||||||
from tea_modulo.preprocessing import DIRECTOR_CLUSTER
|
from tea.preprocessing import DIRECTOR_CLUSTER
|
||||||
pipe = Pipeline.default() # or Pipeline.default(impl="legacy")
|
pipe = Pipeline.default() # or Pipeline.default(impl="legacy")
|
||||||
study = pipe.study("study.edf", plan=DIRECTOR_CLUSTER, age_months=27.5)
|
study = pipe.study("study.edf", plan=DIRECTOR_CLUSTER, age_months=27.5)
|
||||||
pipe.biomarker("posterior_rhythm").measure(study)
|
pipe.biomarker("posterior_rhythm").measure(study)
|
||||||
@@ -51,12 +51,12 @@ table = pipe.map(paths, plan=DIRECTOR_CLUSTER, ages_months=ages,
|
|||||||
rhythm = pipe.biomarker("posterior_rhythm").train(table) # baseline: curves or age_blocks
|
rhythm = pipe.biomarker("posterior_rhythm").train(table) # baseline: curves or age_blocks
|
||||||
rhythm.predict(table.iloc[[0]]) # outside -1/0/+1, z
|
rhythm.predict(table.iloc[[0]]) # outside -1/0/+1, z
|
||||||
|
|
||||||
from tea_modulo.serving import log_plan, log_biomarker # MLflow models, privacy guard
|
from tea.serving import log_plan, log_biomarker # MLflow models, privacy guard
|
||||||
```
|
```
|
||||||
|
|
||||||
Replace a module: `pipe.replace("spindle_detection", MyDetector())`, or register
|
Replace a module: `pipe.replace("spindle_detection", MyDetector())`, or register
|
||||||
it under the same name in the `tea_modulo.modules` entry-point group. Check it
|
it under the same name in the `tea.modules` entry-point group. Check it
|
||||||
with `tea_modulo.contracts.testing`.
|
with `tea.contracts.testing`.
|
||||||
|
|
||||||
## Tests and cluster verification
|
## Tests and cluster verification
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
# tea-verify: the team's dask image plus what the tea_modulo verification needs.
|
# tea-verify: the team's dask image plus what the tea verification needs.
|
||||||
# Built from the local checkout (submodules included) by deploy/verify.sh.
|
# Built from the local checkout (submodules included) by deploy/verify.sh.
|
||||||
FROM 192.168.20.18:5000/dask:1.1
|
FROM 192.168.20.18:5000/dask:1.1
|
||||||
|
|
||||||
# missing from dask:1.1; versions as checked locally
|
# missing from dask:1.1; versions as checked locally
|
||||||
RUN pip install --no-cache-dir "antropy==0.2.3" "fhir.resources==8.3.0" "meegkit==0.2.0" pytest
|
RUN pip install --no-cache-dir "antropy==0.2.3" "fhir.resources==8.3.0" "meegkit==0.2.0" pytest
|
||||||
|
|
||||||
# tea-modulo from the local checkout (biomarcadores-tea @ 7dfc641, codigo @ c7a4736:
|
# tea from the local checkout (biomarcadores-tea @ 7dfc641, codigo @ c7a4736:
|
||||||
# the legacy = submodule tests need them). .dockerignore keeps .venv, eeg/ and any
|
# the legacy = submodule tests need them). .dockerignore keeps .venv, eeg/ and any
|
||||||
# signal or patient file out of the build context.
|
# signal or patient file out of the build context.
|
||||||
COPY . /opt/tea-modulo
|
COPY . /opt/tea
|
||||||
ARG TEA_COMMIT=unknown
|
ARG TEA_COMMIT=unknown
|
||||||
ENV TEA_COMMIT=$TEA_COMMIT
|
ENV TEA_COMMIT=$TEA_COMMIT
|
||||||
LABEL tea_modulo.commit=$TEA_COMMIT
|
LABEL tea.commit=$TEA_COMMIT
|
||||||
RUN pip install --no-cache-dir --no-deps -e /opt/tea-modulo
|
RUN pip install --no-cache-dir --no-deps -e /opt/tea
|
||||||
WORKDIR /opt/tea-modulo
|
WORKDIR /opt/tea
|
||||||
# verification/ (cluster checks) is not in the package: import it from the checkout,
|
# verification/ (cluster checks) is not in the package: import it from the checkout,
|
||||||
# on the runner and on the workers
|
# on the runner and on the workers
|
||||||
ENV PYTHONPATH=/opt/tea-modulo
|
ENV PYTHONPATH=/opt/tea
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# tea-verify: a cluster check of tea_modulo in its own Dask cluster, 9 pods.
|
# tea-verify: a cluster check of tea in its own Dask cluster, 9 pods.
|
||||||
# hk1k: test suite + HK1K check; 4 workers per pod x 4.25 GiB
|
# hk1k: test suite + HK1K check; 4 workers per pod x 4.25 GiB
|
||||||
# issste: ISSSTELEÓN check on processed/eeg-edf-2025|2026 (group summaries
|
# issste: ISSSTELEÓN check on processed/eeg-edf-2025|2026 (group summaries
|
||||||
# only); 3 workers per pod x 6 GiB (long recordings)
|
# only); 3 workers per pod x 6 GiB (long recordings)
|
||||||
@@ -15,7 +15,7 @@ spec:
|
|||||||
containers:
|
containers:
|
||||||
- name: job
|
- name: job
|
||||||
image: 192.168.20.18:5000/tea-verify:COMMIT
|
image: 192.168.20.18:5000/tea-verify:COMMIT
|
||||||
workingDir: /opt/tea-modulo
|
workingDir: /opt/tea
|
||||||
command: [sh, -c]
|
command: [sh, -c]
|
||||||
args:
|
args:
|
||||||
- |
|
- |
|
||||||
|
|||||||
+38
-38
@@ -1,5 +1,5 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "tea-modulo"
|
name = "tea"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
description = "Add your description here"
|
description = "Add your description here"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
@@ -28,47 +28,47 @@ dependencies = [
|
|||||||
export = ["edfio>=0.4.18"]
|
export = ["edfio>=0.4.18"]
|
||||||
s3 = ["s3fs"]
|
s3 = ["s3fs"]
|
||||||
|
|
||||||
[project.entry-points."tea_modulo.legacy_modules"]
|
[project.entry-points."tea.legacy_modules"]
|
||||||
validation = "tea_modulo.legacy.validation:MODULE"
|
validation = "tea.legacy.validation:MODULE"
|
||||||
preprocessing = "tea_modulo.legacy.preprocessing:MODULE"
|
preprocessing = "tea.legacy.preprocessing:MODULE"
|
||||||
annotation_mask = "tea_modulo.legacy.processes.annotation_mask:MODULE"
|
annotation_mask = "tea.legacy.processes.annotation_mask:MODULE"
|
||||||
sleep_state = "tea_modulo.legacy.processes.sleep_state:MODULE"
|
sleep_state = "tea.legacy.processes.sleep_state:MODULE"
|
||||||
posterior_rhythm = "tea_modulo.legacy.biomarkers.posterior_rhythm:MODULE"
|
posterior_rhythm = "tea.legacy.biomarkers.posterior_rhythm:MODULE"
|
||||||
spindle_detection = "tea_modulo.legacy.processes.spindle_detection:MODULE"
|
spindle_detection = "tea.legacy.processes.spindle_detection:MODULE"
|
||||||
spindles = "tea_modulo.legacy.biomarkers.spindles:MODULE"
|
spindles = "tea.legacy.biomarkers.spindles:MODULE"
|
||||||
gradient = "tea_modulo.legacy.biomarkers.gradient:MODULE"
|
gradient = "tea.legacy.biomarkers.gradient:MODULE"
|
||||||
slow_wave_staging = "tea_modulo.legacy.processes.slow_wave_staging:MODULE"
|
slow_wave_staging = "tea.legacy.processes.slow_wave_staging:MODULE"
|
||||||
slow_waves = "tea_modulo.legacy.biomarkers.slow_waves:MODULE"
|
slow_waves = "tea.legacy.biomarkers.slow_waves:MODULE"
|
||||||
aperiodic = "tea_modulo.legacy.biomarkers.aperiodic:MODULE"
|
aperiodic = "tea.legacy.biomarkers.aperiodic:MODULE"
|
||||||
mse = "tea_modulo.legacy.biomarkers.mse:MODULE"
|
mse = "tea.legacy.biomarkers.mse:MODULE"
|
||||||
coupling = "tea_modulo.legacy.biomarkers.coupling:MODULE"
|
coupling = "tea.legacy.biomarkers.coupling:MODULE"
|
||||||
spindle_topography = "tea_modulo.legacy.biomarkers.spindle_topography:MODULE"
|
spindle_topography = "tea.legacy.biomarkers.spindle_topography:MODULE"
|
||||||
spikes = "tea_modulo.legacy.biomarkers.spikes:MODULE"
|
spikes = "tea.legacy.biomarkers.spikes:MODULE"
|
||||||
window_selection = "tea_modulo.legacy.processes.window_selection:MODULE"
|
window_selection = "tea.legacy.processes.window_selection:MODULE"
|
||||||
|
|
||||||
[project.entry-points."tea_modulo.modules"]
|
[project.entry-points."tea.modules"]
|
||||||
validation = "tea_modulo.validation:MODULE"
|
validation = "tea.validation:MODULE"
|
||||||
preprocessing = "tea_modulo.preprocessing:MODULE"
|
preprocessing = "tea.preprocessing:MODULE"
|
||||||
annotation_mask = "tea_modulo.processes.annotation_mask:MODULE"
|
annotation_mask = "tea.processes.annotation_mask:MODULE"
|
||||||
sleep_state = "tea_modulo.processes.sleep_state:MODULE"
|
sleep_state = "tea.processes.sleep_state:MODULE"
|
||||||
posterior_rhythm = "tea_modulo.biomarkers.posterior_rhythm:MODULE"
|
posterior_rhythm = "tea.biomarkers.posterior_rhythm:MODULE"
|
||||||
spindle_detection = "tea_modulo.processes.spindle_detection:MODULE"
|
spindle_detection = "tea.processes.spindle_detection:MODULE"
|
||||||
spindles = "tea_modulo.biomarkers.spindles:MODULE"
|
spindles = "tea.biomarkers.spindles:MODULE"
|
||||||
gradient = "tea_modulo.biomarkers.gradient:MODULE"
|
gradient = "tea.biomarkers.gradient:MODULE"
|
||||||
slow_wave_staging = "tea_modulo.processes.slow_wave_staging:MODULE"
|
slow_wave_staging = "tea.processes.slow_wave_staging:MODULE"
|
||||||
slow_waves = "tea_modulo.biomarkers.slow_waves:MODULE"
|
slow_waves = "tea.biomarkers.slow_waves:MODULE"
|
||||||
aperiodic = "tea_modulo.biomarkers.aperiodic:MODULE"
|
aperiodic = "tea.biomarkers.aperiodic:MODULE"
|
||||||
mse = "tea_modulo.biomarkers.mse:MODULE"
|
mse = "tea.biomarkers.mse:MODULE"
|
||||||
coupling = "tea_modulo.biomarkers.coupling:MODULE"
|
coupling = "tea.biomarkers.coupling:MODULE"
|
||||||
spindle_topography = "tea_modulo.biomarkers.spindle_topography:MODULE"
|
spindle_topography = "tea.biomarkers.spindle_topography:MODULE"
|
||||||
spikes = "tea_modulo.biomarkers.spikes:MODULE"
|
spikes = "tea.biomarkers.spikes:MODULE"
|
||||||
window_selection = "tea_modulo.processes.window_selection:MODULE"
|
window_selection = "tea.processes.window_selection:MODULE"
|
||||||
|
|
||||||
[project.entry-points."tea_modulo.executors"]
|
[project.entry-points."tea.executors"]
|
||||||
legacy = "tea_modulo.legacy.executor:run_serial"
|
legacy = "tea.legacy.executor:run_serial"
|
||||||
|
|
||||||
[project.scripts]
|
[project.scripts]
|
||||||
ktlx2edf = "tea_modulo.export.cli:main"
|
ktlx2edf = "tea.export.cli:main"
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["uv_build>=0.13.1,<0.14.0"]
|
requires = ["uv_build>=0.13.1,<0.14.0"]
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
"""
|
"""
|
||||||
tea_modulo: modular EEG library (EDF in, validation, preprocessing,
|
tea: modular EEG library (EDF in, validation, preprocessing,
|
||||||
processes and biomarkers out).
|
processes and biomarkers out).
|
||||||
|
|
||||||
Every biomarker and every process is its own module. Modules talk only
|
Every biomarker and every process is its own module. Modules talk only
|
||||||
through `tea_modulo.contracts`; see the architecture plan.
|
through `tea.contracts`; see the architecture plan.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__version__ = "0.1.0"
|
__version__ = "0.1.0"
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
from tea.biomarkers.aperiodic.api import MODULE, Aperiodic
|
||||||
|
|
||||||
|
__all__ = ["MODULE", "Aperiodic"]
|
||||||
@@ -23,7 +23,7 @@ from pathlib import Path
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
from tea_modulo.contracts import CONTRACT_VERSION, DEVIATION_COLUMNS
|
from tea.contracts import CONTRACT_VERSION, DEVIATION_COLUMNS
|
||||||
|
|
||||||
from . import _baseline, _windows2s
|
from . import _baseline, _windows2s
|
||||||
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
from tea.biomarkers.coupling.api import MODULE, Coupling
|
||||||
|
|
||||||
|
__all__ = ["MODULE", "Coupling"]
|
||||||
@@ -15,7 +15,7 @@ from pathlib import Path
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
from tea_modulo.contracts import CONTRACT_VERSION, DEVIATION_COLUMNS
|
from tea.contracts import CONTRACT_VERSION, DEVIATION_COLUMNS
|
||||||
|
|
||||||
from . import _baseline, _signal
|
from . import _baseline, _signal
|
||||||
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
from tea.biomarkers.gradient.api import MODULE, Gradient
|
||||||
|
|
||||||
|
__all__ = ["MODULE", "Gradient"]
|
||||||
@@ -18,7 +18,7 @@ from pathlib import Path
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
from tea_modulo.contracts import CONTRACT_VERSION, DEVIATION_COLUMNS
|
from tea.contracts import CONTRACT_VERSION, DEVIATION_COLUMNS
|
||||||
|
|
||||||
from . import _baseline
|
from . import _baseline
|
||||||
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
from tea.biomarkers.mse.api import MODULE, MSE
|
||||||
|
|
||||||
|
__all__ = ["MODULE", "MSE"]
|
||||||
@@ -20,7 +20,7 @@ from pathlib import Path
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
from tea_modulo.contracts import CONTRACT_VERSION, DEVIATION_COLUMNS
|
from tea.contracts import CONTRACT_VERSION, DEVIATION_COLUMNS
|
||||||
|
|
||||||
from . import _baseline, _windows2s
|
from . import _baseline, _windows2s
|
||||||
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
from tea.biomarkers.posterior_rhythm.api import MODULE, PosteriorRhythm
|
||||||
|
|
||||||
|
__all__ = ["MODULE", "PosteriorRhythm"]
|
||||||
+1
-1
@@ -17,7 +17,7 @@ from pathlib import Path
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
from tea_modulo.contracts import CONTRACT_VERSION, DEVIATION_COLUMNS
|
from tea.contracts import CONTRACT_VERSION, DEVIATION_COLUMNS
|
||||||
|
|
||||||
from . import _baseline
|
from . import _baseline
|
||||||
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
from tea.biomarkers.slow_waves.api import MODULE, SlowWaves
|
||||||
|
|
||||||
|
__all__ = ["MODULE", "SlowWaves"]
|
||||||
@@ -12,7 +12,7 @@ from pathlib import Path
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
from tea_modulo.contracts import CONTRACT_VERSION, DEVIATION_COLUMNS
|
from tea.contracts import CONTRACT_VERSION, DEVIATION_COLUMNS
|
||||||
|
|
||||||
from . import _baseline
|
from . import _baseline
|
||||||
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
from tea.biomarkers.spikes.api import MODULE, Spikes
|
||||||
|
|
||||||
|
__all__ = ["MODULE", "Spikes"]
|
||||||
@@ -13,7 +13,7 @@ from pathlib import Path
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
from tea_modulo.contracts import CONTRACT_VERSION, DEVIATION_COLUMNS
|
from tea.contracts import CONTRACT_VERSION, DEVIATION_COLUMNS
|
||||||
|
|
||||||
from . import _baseline, _detector
|
from . import _baseline, _detector
|
||||||
FEATURES = {"spike_rate_awake": "tasa_despierto", "spike_rate_nrem": "tasa_NREM",
|
FEATURES = {"spike_rate_awake": "tasa_despierto", "spike_rate_nrem": "tasa_NREM",
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
from tea.biomarkers.spindle_topography.api import MODULE, SpindleTopography
|
||||||
|
|
||||||
|
__all__ = ["MODULE", "SpindleTopography"]
|
||||||
+1
-1
@@ -15,7 +15,7 @@ from pathlib import Path
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
from tea_modulo.contracts import CONTRACT_VERSION, DEVIATION_COLUMNS
|
from tea.contracts import CONTRACT_VERSION, DEVIATION_COLUMNS
|
||||||
|
|
||||||
from . import _baseline, _signal
|
from . import _baseline, _signal
|
||||||
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
from tea.biomarkers.spindles.api import MODULE, Spindles
|
||||||
|
|
||||||
|
__all__ = ["MODULE", "Spindles"]
|
||||||
@@ -13,7 +13,7 @@ from pathlib import Path
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
from tea_modulo.contracts import CONTRACT_VERSION, DEVIATION_COLUMNS
|
from tea.contracts import CONTRACT_VERSION, DEVIATION_COLUMNS
|
||||||
|
|
||||||
from . import _baseline
|
from . import _baseline
|
||||||
|
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
"""
|
"""
|
||||||
The shared API of `tea_modulo`: the only code every module may import.
|
The shared API of `tea`: the only code every module may import.
|
||||||
|
|
||||||
from tea_modulo.contracts import Recording, Preprocessed, Study, Labels
|
from tea.contracts import Recording, Preprocessed, Study, Labels
|
||||||
from tea_modulo.contracts import check_module, CONTRACT_VERSION
|
from tea.contracts import check_module, CONTRACT_VERSION
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from tea_modulo.contracts.data import (
|
from tea.contracts.data import (
|
||||||
CONTRACT_VERSION,
|
CONTRACT_VERSION,
|
||||||
DEVIATION_COLUMNS,
|
DEVIATION_COLUMNS,
|
||||||
SPAN_COLUMNS,
|
SPAN_COLUMNS,
|
||||||
@@ -18,7 +18,7 @@ from tea_modulo.contracts.data import (
|
|||||||
empty_spans,
|
empty_spans,
|
||||||
sha256_of,
|
sha256_of,
|
||||||
)
|
)
|
||||||
from tea_modulo.contracts.protocols import (
|
from tea.contracts.protocols import (
|
||||||
KINDS,
|
KINDS,
|
||||||
Biomarker,
|
Biomarker,
|
||||||
ContractError,
|
ContractError,
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
"""
|
"""
|
||||||
Data that crosses module boundaries.
|
Data that crosses module boundaries.
|
||||||
|
|
||||||
Every module in `tea_modulo` talks to the others only through these frozen
|
Every module in `tea` talks to the others only through these frozen
|
||||||
dataclasses and the protocols in `contracts.protocols`. A module may be
|
dataclasses and the protocols in `contracts.protocols`. A module may be
|
||||||
replaced completely by any code that consumes and produces these objects.
|
replaced completely by any code that consumes and produces these objects.
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ from typing import Any, Protocol, runtime_checkable
|
|||||||
|
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
from tea_modulo.contracts.data import (
|
from tea.contracts.data import (
|
||||||
CONTRACT_VERSION,
|
CONTRACT_VERSION,
|
||||||
Labels,
|
Labels,
|
||||||
Preprocessed,
|
Preprocessed,
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
Contract test suites: run them against any implementation of a module,
|
Contract test suites: run them against any implementation of a module,
|
||||||
including a replacement written outside this package.
|
including a replacement written outside this package.
|
||||||
|
|
||||||
from tea_modulo.contracts.testing import check_process, check_biomarker
|
from tea.contracts.testing import check_process, check_biomarker
|
||||||
check_process(MyDetector(), study)
|
check_process(MyDetector(), study)
|
||||||
check_biomarker(MyBiomarker(), studies, ages_months)
|
check_biomarker(MyBiomarker(), studies, ages_months)
|
||||||
|
|
||||||
@@ -19,14 +19,14 @@ from pathlib import Path
|
|||||||
|
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
from tea_modulo.contracts.data import (
|
from tea.contracts.data import (
|
||||||
DEVIATION_COLUMNS,
|
DEVIATION_COLUMNS,
|
||||||
Labels,
|
Labels,
|
||||||
Preprocessed,
|
Preprocessed,
|
||||||
Study,
|
Study,
|
||||||
ValidationSummary,
|
ValidationSummary,
|
||||||
)
|
)
|
||||||
from tea_modulo.contracts.protocols import check_module
|
from tea.contracts.protocols import check_module
|
||||||
|
|
||||||
|
|
||||||
def check_process(module, study: Study):
|
def check_process(module, study: Study):
|
||||||
@@ -2,13 +2,13 @@
|
|||||||
Optional KTLX (Natus/Xltek) -> EDF+ exporter, vendored from the `eeg` library
|
Optional KTLX (Natus/Xltek) -> EDF+ exporter, vendored from the `eeg` library
|
||||||
(Gitea alberto/eeg @ 92bc2a0, src/eeg/utils). Only the imports were changed.
|
(Gitea alberto/eeg @ 92bc2a0, src/eeg/utils). Only the imports were changed.
|
||||||
|
|
||||||
Outside the pipeline: everything else in tea_modulo takes EDF. Install with
|
Outside the pipeline: everything else in tea takes EDF. Install with
|
||||||
the `export` extra (needs edfio).
|
the `export` extra (needs edfio).
|
||||||
|
|
||||||
from tea_modulo.export import ktlx_to_edf
|
from tea.export import ktlx_to_edf
|
||||||
ktlx_to_edf("natus/STUDY_FOLDER", "study.edf")
|
ktlx_to_edf("natus/STUDY_FOLDER", "study.edf")
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from tea_modulo.export.edf_export import ktlx_to_edf
|
from tea.export.edf_export import ktlx_to_edf
|
||||||
|
|
||||||
__all__ = ["ktlx_to_edf"]
|
__all__ = ["ktlx_to_edf"]
|
||||||
@@ -9,7 +9,7 @@ from __future__ import annotations
|
|||||||
import argparse
|
import argparse
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from tea_modulo.export.edf_export import ktlx_to_edf
|
from tea.export.edf_export import ktlx_to_edf
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -29,10 +29,10 @@ from pathlib import Path
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
from edfio import Edf, EdfAnnotation
|
from edfio import Edf, EdfAnnotation
|
||||||
|
|
||||||
from tea_modulo.export import ktlx, patient
|
from tea.export import ktlx, patient
|
||||||
from tea_modulo.export.edf_annotations import event_annotations, gap_annotations, runs
|
from tea.export.edf_annotations import event_annotations, gap_annotations, runs
|
||||||
from tea_modulo.export.edf_header import patient_header, recording_header
|
from tea.export.edf_header import patient_header, recording_header
|
||||||
from tea_modulo.export.edf_signals import build_signals
|
from tea.export.edf_signals import build_signals
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ from datetime import date
|
|||||||
|
|
||||||
from edfio import Patient, Recording
|
from edfio import Patient, Recording
|
||||||
|
|
||||||
from tea_modulo.export.text import to_ascii
|
from tea.export.text import to_ascii
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ import numpy as np
|
|||||||
from edfio import EdfSignal
|
from edfio import EdfSignal
|
||||||
from edfio.edf_signal import _round_float_to_8_characters
|
from edfio.edf_signal import _round_float_to_8_characters
|
||||||
|
|
||||||
from tea_modulo.export.text import to_ascii
|
from tea.export.text import to_ascii
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@ from pathlib import Path
|
|||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
from tea_modulo.export import text as _txt
|
from tea.export import text as _txt
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ from collections.abc import Sequence
|
|||||||
from datetime import date, datetime, timedelta
|
from datetime import date, datetime, timedelta
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from tea_modulo.export import text as _txt
|
from tea.export import text as _txt
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
from tea.legacy.biomarkers.aperiodic.api import MODULE, LegacyAperiodic
|
||||||
|
|
||||||
|
__all__ = ["MODULE", "LegacyAperiodic"]
|
||||||
+1
-1
@@ -17,7 +17,7 @@ from pathlib import Path
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
from tea_modulo.contracts import CONTRACT_VERSION, DEVIATION_COLUMNS
|
from tea.contracts import CONTRACT_VERSION, DEVIATION_COLUMNS
|
||||||
|
|
||||||
from . import _baseline, _windows2s
|
from . import _baseline, _windows2s
|
||||||
from ._bio import aperiodico, espectro
|
from ._bio import aperiodico, espectro
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
from tea.legacy.biomarkers.coupling.api import MODULE, LegacyCoupling
|
||||||
|
|
||||||
|
__all__ = ["MODULE", "LegacyCoupling"]
|
||||||
+1
-1
@@ -17,7 +17,7 @@ from pathlib import Path
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
from tea_modulo.contracts import CONTRACT_VERSION, DEVIATION_COLUMNS
|
from tea.contracts import CONTRACT_VERSION, DEVIATION_COLUMNS
|
||||||
|
|
||||||
from . import _adapter, _baseline
|
from . import _adapter, _baseline
|
||||||
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
from tea.legacy.biomarkers.gradient.api import MODULE, LegacyGradient
|
||||||
|
|
||||||
|
__all__ = ["MODULE", "LegacyGradient"]
|
||||||
+1
-1
@@ -16,7 +16,7 @@ from pathlib import Path
|
|||||||
|
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
from tea_modulo.contracts import CONTRACT_VERSION, DEVIATION_COLUMNS
|
from tea.contracts import CONTRACT_VERSION, DEVIATION_COLUMNS
|
||||||
|
|
||||||
from . import _adapter, _baseline
|
from . import _adapter, _baseline
|
||||||
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
from tea.legacy.biomarkers.mse.api import MODULE, LegacyMSE
|
||||||
|
|
||||||
|
__all__ = ["MODULE", "LegacyMSE"]
|
||||||
@@ -16,7 +16,7 @@ from pathlib import Path
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
from tea_modulo.contracts import CONTRACT_VERSION, DEVIATION_COLUMNS
|
from tea.contracts import CONTRACT_VERSION, DEVIATION_COLUMNS
|
||||||
|
|
||||||
from . import _baseline, _windows2s
|
from . import _baseline, _windows2s
|
||||||
from ._bio import complejidad
|
from ._bio import complejidad
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
from tea.legacy.biomarkers.posterior_rhythm.api import MODULE, LegacyPosteriorRhythm
|
||||||
|
|
||||||
|
__all__ = ["MODULE", "LegacyPosteriorRhythm"]
|
||||||
+1
-1
@@ -19,7 +19,7 @@ from pathlib import Path
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
from tea_modulo.contracts import CONTRACT_VERSION, DEVIATION_COLUMNS
|
from tea.contracts import CONTRACT_VERSION, DEVIATION_COLUMNS
|
||||||
|
|
||||||
from . import _adapter, _baseline
|
from . import _adapter, _baseline
|
||||||
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
from tea.legacy.biomarkers.slow_waves.api import MODULE, LegacySlowWaves
|
||||||
|
|
||||||
|
__all__ = ["MODULE", "LegacySlowWaves"]
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user