Skip to content

1.3.0

Latest

Choose a tag to compare

@dfeen87 dfeen87 released this 23 Mar 10:15
· 3 commits to main since this release
2c44af4

Triadic‑Biosignal‑Monitor v1.3.0

Reproducibility, Stability, and Configuration Alignment Release

This release delivers a focused hardening pass across the operator core, pipelines, configuration system, and packaging. The goal is to ensure full reproducibility, eliminate silent drift between YAML and runtime behavior, and improve robustness across EEG‑only, ECG‑only, coupled, and streaming modes. No breaking API changes were introduced.


Core Operator & Feature Improvements

1. Canonical PLV Implementation

  • Removed the duplicate 40‑line phase_locking_value function in core/features.py.
  • All PLV computations now use the canonical implementation from core/phase.py.
  • Existing imports (from core.features import phase_locking_value) continue to work via re‑export.

2. Normalized Operator Method Strings

  • Added method = method.lower() in both compute_delta_I and compute_delta_C.
  • YAML values such as "PLV", "Coherence", "Permutation_Entropy" now resolve correctly.

3. Entropy Parameter Consistency

  • Removed silent overrides that forced order=4 and normalize=False.
  • compute_delta_I now respects its documented defaults (order=3, delay=1, normalize=True) unless overridden by config.
  • Updated entropy tests to use lower noise (1%) for stable detection under normalized entropy.

Sliding Window & RR Extraction Robustness

4. Windowing Edge‑Case Guards

  • Added validation for overlap: raises ValueError unless 0 ≤ overlap < 1.
  • Added short‑signal guard: if len(signal) < window_samples, pipelines emit a warning and return empty outputs.

5. RR Interval Safety Checks

  • CoupledPipeline: now returns a clean no‑decision when baseline or current RR < 5 intervals (instead of silently degrading to EEG‑only).
  • ECGOnlyPipeline: added baseline RR length check.
  • StreamingPipeline: both _process_ecg_only and _process_coupled now require baseline and current RR ≥ 5; warnings include RR counts for debugging.

Configuration System Overhaul

6. New core/config_adapter.py

  • Introduces adapt_config(raw_config) to flatten nested YAML structures into the flat dict expected by pipelines.
  • Normalizes delta_C_method and delta_I_method to lowercase.
  • Backwards‑compatible with legacy flat configs.

7. Pipeline Integration

  • All pipelines (eeg_only, ecg_only, coupled) now receive:
    • entropy_kwargs
    • delta_I_method
    • delta_C_method
  • Hardcoded operator selections removed; YAML now fully controls runtime behavior.

8. New Test Suite for Config Behavior

  • Added tests/test_config_adapter.py with 11 tests covering:
    • PLV/plv case‑insensitivity
    • Entropy order/delay flowing correctly from YAML
    • Window size/overlap affecting actual windowing

NumPy 2.0 Compatibility

9. np.trapznp.trapezoid

  • Updated in core/features.py and core/metrics.py.
  • Resolves 11 previously failing tests under NumPy 2.0.

Packaging, Versioning & Documentation

10. Unified Version Source

  • Added triadic_biosignal_monitor/__init__.py with __version__ = "1.3.0".
  • setup.py now reads the version via regex, ensuring a single source of truth.

11. Dependency Alignment

Added missing runtime dependencies with consistent version pinning:

  • neurokit2>=0.2.0,<1.0.0
  • PyWavelets>=1.4.0
  • antropy>=0.1.6
  • nolds>=0.5.2
  • h5py>=3.8.0
  • ipywidgets>=8.0.0

Aligned existing constraints with README requirements (numpy>=1.24, scipy>=1.10, mne>=1.3, etc.).

12. README Cleanup

  • Fixed clone URL and all lowercase repo references.
  • Removed broken documentation links.
  • Consolidated duplicate dependency lists; now points to requirements.txt.

Security

  • CodeQL scan reports 0 alerts.
  • No vulnerabilities introduced or detected.