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_valuefunction incore/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 bothcompute_delta_Iandcompute_delta_C. - YAML values such as
"PLV","Coherence","Permutation_Entropy"now resolve correctly.
3. Entropy Parameter Consistency
- Removed silent overrides that forced
order=4andnormalize=False. compute_delta_Inow 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: raisesValueErrorunless0 ≤ 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_onlyand_process_couplednow 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_methodanddelta_I_methodto lowercase. - Backwards‑compatible with legacy flat configs.
7. Pipeline Integration
- All pipelines (
eeg_only,ecg_only,coupled) now receive:entropy_kwargsdelta_I_methoddelta_C_method
- Hardcoded operator selections removed; YAML now fully controls runtime behavior.
8. New Test Suite for Config Behavior
- Added
tests/test_config_adapter.pywith 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.trapz → np.trapezoid
- Updated in
core/features.pyandcore/metrics.py. - Resolves 11 previously failing tests under NumPy 2.0.
Packaging, Versioning & Documentation
10. Unified Version Source
- Added
triadic_biosignal_monitor/__init__.pywith__version__ = "1.3.0". setup.pynow 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.0PyWavelets>=1.4.0antropy>=0.1.6nolds>=0.5.2h5py>=3.8.0ipywidgets>=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.