biosigpy 0.3.2__tar.gz → 0.3.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {biosigpy-0.3.2 → biosigpy-0.3.3}/CHANGELOG.md +6 -0
- {biosigpy-0.3.2/src/biosigpy.egg-info → biosigpy-0.3.3}/PKG-INFO +1 -1
- {biosigpy-0.3.2 → biosigpy-0.3.3}/src/biosigpy/_version.py +1 -1
- {biosigpy-0.3.2 → biosigpy-0.3.3}/src/biosigpy/tools/snap_to_peak.py +21 -13
- {biosigpy-0.3.2 → biosigpy-0.3.3/src/biosigpy.egg-info}/PKG-INFO +1 -1
- {biosigpy-0.3.2 → biosigpy-0.3.3}/LICENSE +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/MANIFEST.in +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/README.md +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/biosiglib.lock +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/docs/api/ecg/baselineremove.md +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/docs/api/ecg/pantompkins.md +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/docs/api/ecg/sloperange.md +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/docs/api/hrv/fdmetrics.md +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/docs/api/hrv/fillgaps.md +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/docs/api/hrv/ipfm.md +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/docs/api/hrv/osp.md +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/docs/api/hrv/removefp.md +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/docs/api/hrv/tdmetrics.md +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/docs/api/index.md +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/docs/api/tools/lpd-filter.md +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/docs/api/tools/medfilt-threshold.md +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/docs/api/tools/nan-filter.md +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/docs/api/tools/nan-filtfilt.md +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/docs/api/tools/snap-to-peak.md +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/docs/index.md +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/docs/installation.md +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/examples/README.md +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/examples/_support/__init__.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/examples/_support/figures.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/examples/ecg/baselineremove_example.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/examples/ecg/pantompkins_example.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/examples/ecg/sloperange_example.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/examples/fixtures/ecg/medicom_mtd_ecg_respiration.csv +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/examples/fixtures/ecg/medicom_mtd_r_wave_timing.csv +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/examples/hrv/fdmetrics_example.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/examples/hrv/fillgaps_example.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/examples/hrv/ipfm_example.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/examples/hrv/osp_example.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/examples/hrv/removefp_example.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/examples/hrv/tdmetrics_example.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/mkdocs.yml +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/pyproject.toml +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/pytest.ini +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/requirements-dev.txt +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/setup.cfg +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/src/biosigpy/__init__.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/src/biosigpy/ecg/__init__.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/src/biosigpy/ecg/baselineremove.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/src/biosigpy/ecg/pantompkins.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/src/biosigpy/ecg/sloperange.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/src/biosigpy/hrv/__init__.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/src/biosigpy/hrv/_fillgaps_debug.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/src/biosigpy/hrv/fdmetrics.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/src/biosigpy/hrv/fillgaps.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/src/biosigpy/hrv/ipfm.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/src/biosigpy/hrv/osp.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/src/biosigpy/hrv/removefp.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/src/biosigpy/hrv/tdmetrics.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/src/biosigpy/tools/__init__.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/src/biosigpy/tools/_nan_processing.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/src/biosigpy/tools/_validation.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/src/biosigpy/tools/lpd_filter.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/src/biosigpy/tools/medfilt_threshold.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/src/biosigpy/tools/nan_filter.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/src/biosigpy/tools/nan_filtfilt.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/src/biosigpy.egg-info/SOURCES.txt +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/src/biosigpy.egg-info/dependency_links.txt +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/src/biosigpy.egg-info/requires.txt +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/src/biosigpy.egg-info/top_level.txt +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/tests/conformance.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/tests/conftest.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/tests/test_baselineremove.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/tests/test_conformance_coverage.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/tests/test_example_figures.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/tests/test_fdmetrics.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/tests/test_fillgaps.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/tests/test_ipfm.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/tests/test_lpd_filter.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/tests/test_medfilt_threshold.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/tests/test_nan_filter.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/tests/test_nan_filtfilt.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/tests/test_osp.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/tests/test_package_metadata.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/tests/test_pantompkins.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/tests/test_removefp.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/tests/test_sloperange.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/tests/test_snap_to_peak.py +0 -0
- {biosigpy-0.3.2 → biosigpy-0.3.3}/tests/test_tdmetrics.py +0 -0
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
This file is the authoritative release history. GitHub Releases reuse the corresponding version section.
|
|
4
4
|
|
|
5
|
+
## 0.3.3 - 2026-08-18
|
|
6
|
+
|
|
7
|
+
- Optimized `tools.snap_to_peak` by indexing NaN gaps once and reusing finite-segment boundaries, eliminating repeated full-signal scans while preserving refined detections.
|
|
8
|
+
- Added a fast path for finite ECG signals and logarithmic gap lookup for signals containing NaN segments.
|
|
9
|
+
- Updated GitHub workflows to `actions/checkout@v7` and `actions/setup-python@v7`, removing the deprecated Node.js 20 action runtime.
|
|
10
|
+
|
|
5
11
|
## 0.3.2 - 2026-08-18
|
|
6
12
|
|
|
7
13
|
- Optimized `hrv.osp` by applying the orthogonal projection associatively, avoiding the square projection matrix while preserving the defined decomposition.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: biosigpy
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.3
|
|
4
4
|
Summary: Python implementation of the Biosiglib specifications for biomedical signal processing.
|
|
5
5
|
License-Expression: GPL-3.0-only
|
|
6
6
|
Project-URL: Documentation, https://bsicos.github.io/biosigpy/
|
|
@@ -81,6 +81,11 @@ def snap_to_peak(
|
|
|
81
81
|
window_size = as_positive_real_scalar(window_size, name="window_size")
|
|
82
82
|
window_size = _round_positive_half_up(window_size)
|
|
83
83
|
|
|
84
|
+
# Reuse gap positions instead of rescanning the finite segment for every
|
|
85
|
+
# detection, which becomes quadratic in practice on gap-free ECG signals.
|
|
86
|
+
nan_indices = np.flatnonzero(np.isnan(ecg))
|
|
87
|
+
has_nan_gaps = nan_indices.size > 0
|
|
88
|
+
last_sample_index = ecg.size - 1
|
|
84
89
|
refined_detections = np.empty(detections.size, dtype=np.float64)
|
|
85
90
|
for detection_index, current_detection in enumerate(detections):
|
|
86
91
|
if np.isnan(current_detection):
|
|
@@ -92,7 +97,22 @@ def snap_to_peak(
|
|
|
92
97
|
refined_detections[detection_index] = np.nan
|
|
93
98
|
continue
|
|
94
99
|
|
|
95
|
-
|
|
100
|
+
if has_nan_gaps:
|
|
101
|
+
gap_position = int(np.searchsorted(nan_indices, current_detection))
|
|
102
|
+
segment_start = (
|
|
103
|
+
int(nan_indices[gap_position - 1]) + 1
|
|
104
|
+
if gap_position > 0
|
|
105
|
+
else 0
|
|
106
|
+
)
|
|
107
|
+
segment_end = (
|
|
108
|
+
int(nan_indices[gap_position]) - 1
|
|
109
|
+
if gap_position < nan_indices.size
|
|
110
|
+
else last_sample_index
|
|
111
|
+
)
|
|
112
|
+
else:
|
|
113
|
+
segment_start = 0
|
|
114
|
+
segment_end = last_sample_index
|
|
115
|
+
|
|
96
116
|
window_start = max(segment_start, current_detection - window_size)
|
|
97
117
|
window_end = min(segment_end, current_detection + window_size)
|
|
98
118
|
window_signal = ecg[window_start : window_end + 1]
|
|
@@ -104,15 +124,3 @@ def snap_to_peak(
|
|
|
104
124
|
|
|
105
125
|
def _round_positive_half_up(value: float) -> int:
|
|
106
126
|
return int(np.floor(float(value) + 0.5))
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
def _finite_segment_bounds(ecg: np.ndarray, sample_index: int) -> tuple[int, int]:
|
|
110
|
-
segment_start = sample_index
|
|
111
|
-
while segment_start > 0 and np.isfinite(ecg[segment_start - 1]):
|
|
112
|
-
segment_start -= 1
|
|
113
|
-
|
|
114
|
-
segment_end = sample_index
|
|
115
|
-
while segment_end + 1 < ecg.size and np.isfinite(ecg[segment_end + 1]):
|
|
116
|
-
segment_end += 1
|
|
117
|
-
|
|
118
|
-
return segment_start, segment_end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: biosigpy
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.3
|
|
4
4
|
Summary: Python implementation of the Biosiglib specifications for biomedical signal processing.
|
|
5
5
|
License-Expression: GPL-3.0-only
|
|
6
6
|
Project-URL: Documentation, https://bsicos.github.io/biosigpy/
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|