wfdb 4.1.2__tar.gz → 4.2.0__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.
- wfdb-4.2.0/.gitattributes +14 -0
- wfdb-4.2.0/.github/workflows/docs.yml +23 -0
- wfdb-4.2.0/.github/workflows/test.yml +65 -0
- wfdb-4.2.0/.gitignore +74 -0
- wfdb-4.2.0/.readthedocs.yml +17 -0
- wfdb-4.2.0/DEVELOPING.md +82 -0
- {wfdb-4.1.2 → wfdb-4.2.0}/PKG-INFO +30 -40
- {wfdb-4.1.2 → wfdb-4.2.0}/README.md +10 -12
- wfdb-4.2.0/activate +66 -0
- wfdb-4.2.0/docs/Makefile +20 -0
- wfdb-4.2.0/docs/_static/.gitkeep +0 -0
- wfdb-4.2.0/docs/_templates/.gitkeep +0 -0
- wfdb-4.2.0/docs/changes.rst +83 -0
- wfdb-4.2.0/docs/conf.py +183 -0
- wfdb-4.2.0/docs/convert.rst +35 -0
- wfdb-4.2.0/docs/index.rst +53 -0
- wfdb-4.2.0/docs/installation.rst +10 -0
- wfdb-4.2.0/docs/io.rst +37 -0
- wfdb-4.2.0/docs/plot.rst +5 -0
- wfdb-4.2.0/docs/processing.rst +46 -0
- wfdb-4.2.0/docs/requirements.txt +4 -0
- wfdb-4.2.0/docs/wfdb-specifications.rst +16 -0
- wfdb-4.2.0/docs/wfdb.rst +44 -0
- wfdb-4.2.0/pylintrc +564 -0
- wfdb-4.2.0/pyproject.toml +49 -0
- {wfdb-4.1.2 → wfdb-4.2.0}/wfdb/io/_header.py +3 -3
- {wfdb-4.1.2 → wfdb-4.2.0}/wfdb/io/_signal.py +182 -138
- {wfdb-4.1.2 → wfdb-4.2.0}/wfdb/io/annotation.py +12 -10
- {wfdb-4.1.2 → wfdb-4.2.0}/wfdb/io/convert/csv.py +12 -8
- {wfdb-4.1.2 → wfdb-4.2.0}/wfdb/io/convert/edf.py +11 -4
- {wfdb-4.1.2 → wfdb-4.2.0}/wfdb/io/convert/tff.py +1 -0
- {wfdb-4.1.2 → wfdb-4.2.0}/wfdb/io/download.py +5 -7
- {wfdb-4.1.2 → wfdb-4.2.0}/wfdb/io/header.py +1 -0
- {wfdb-4.1.2 → wfdb-4.2.0}/wfdb/io/record.py +102 -49
- {wfdb-4.1.2 → wfdb-4.2.0}/wfdb/io/util.py +1 -0
- {wfdb-4.1.2 → wfdb-4.2.0}/wfdb/plot/__init__.py +1 -0
- {wfdb-4.1.2 → wfdb-4.2.0}/wfdb/processing/evaluate.py +3 -3
- {wfdb-4.1.2 → wfdb-4.2.0}/wfdb/processing/peaks.py +1 -1
- {wfdb-4.1.2 → wfdb-4.2.0}/wfdb/processing/qrs.py +108 -20
- wfdb-4.2.0/wfdb/version.py +1 -0
- wfdb-4.1.2/pyproject.toml +0 -37
- wfdb-4.1.2/wfdb/version.py +0 -1
- {wfdb-4.1.2 → wfdb-4.2.0}/LICENSE +0 -0
- {wfdb-4.1.2 → wfdb-4.2.0}/wfdb/__init__.py +0 -0
- {wfdb-4.1.2 → wfdb-4.2.0}/wfdb/io/__init__.py +0 -0
- {wfdb-4.1.2 → wfdb-4.2.0}/wfdb/io/_coreio.py +0 -0
- {wfdb-4.1.2 → wfdb-4.2.0}/wfdb/io/_url.py +0 -0
- {wfdb-4.1.2 → wfdb-4.2.0}/wfdb/io/convert/__init__.py +0 -0
- {wfdb-4.1.2 → wfdb-4.2.0}/wfdb/io/convert/matlab.py +0 -0
- {wfdb-4.1.2 → wfdb-4.2.0}/wfdb/io/convert/wav.py +0 -0
- {wfdb-4.1.2 → wfdb-4.2.0}/wfdb/io/datasource.py +0 -0
- {wfdb-4.1.2 → wfdb-4.2.0}/wfdb/plot/plot.py +0 -0
- {wfdb-4.1.2 → wfdb-4.2.0}/wfdb/processing/__init__.py +0 -0
- {wfdb-4.1.2 → wfdb-4.2.0}/wfdb/processing/basic.py +0 -0
- {wfdb-4.1.2 → wfdb-4.2.0}/wfdb/processing/filter.py +0 -0
- {wfdb-4.1.2 → wfdb-4.2.0}/wfdb/processing/hr.py +0 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
name: Build
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
pull_request:
|
|
8
|
+
branches:
|
|
9
|
+
- main
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
docs:
|
|
13
|
+
runs-on: ubuntu-20.04
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v3
|
|
16
|
+
- name: Install dependencies
|
|
17
|
+
run: |
|
|
18
|
+
python -m pip install --upgrade pip
|
|
19
|
+
pip install -r docs/requirements.txt
|
|
20
|
+
- name: Build documentation
|
|
21
|
+
run: |
|
|
22
|
+
cd docs
|
|
23
|
+
make html
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
name: Test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
pull_request:
|
|
8
|
+
branches:
|
|
9
|
+
- main
|
|
10
|
+
|
|
11
|
+
env:
|
|
12
|
+
NPY_PROMOTION_STATE: weak_and_warn
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
test:
|
|
16
|
+
name: Python ${{ matrix.python-version }} / ${{ matrix.os }} / ${{ matrix.numpy }}
|
|
17
|
+
strategy:
|
|
18
|
+
fail-fast: false
|
|
19
|
+
matrix:
|
|
20
|
+
os: [windows-latest, ubuntu-latest, macos-latest]
|
|
21
|
+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
|
|
22
|
+
numpy: ["numpy"]
|
|
23
|
+
include:
|
|
24
|
+
- os: ubuntu-latest
|
|
25
|
+
python-version: "3.9"
|
|
26
|
+
numpy: "numpy==1.26.4"
|
|
27
|
+
runs-on: ${{ matrix.os }}
|
|
28
|
+
steps:
|
|
29
|
+
- uses: actions/checkout@v4
|
|
30
|
+
- uses: astral-sh/setup-uv@v3
|
|
31
|
+
- name: Install Python ${{ matrix.python-version }}
|
|
32
|
+
run: uv python install ${{ matrix.python-version }}
|
|
33
|
+
- name: Install libsndfile
|
|
34
|
+
if: startsWith(matrix.os, 'ubuntu')
|
|
35
|
+
run: sudo apt-get install -y libsndfile1
|
|
36
|
+
- name: Run tests
|
|
37
|
+
run: uv run --with ${{ matrix.numpy }} --extra dev pytest
|
|
38
|
+
- name: Check style
|
|
39
|
+
run: uv run --extra dev black --check --diff .
|
|
40
|
+
|
|
41
|
+
test-deb10-i386:
|
|
42
|
+
name: Python 3.7 on Debian 10 i386
|
|
43
|
+
runs-on: ubuntu-latest
|
|
44
|
+
container: i386/debian:10
|
|
45
|
+
steps:
|
|
46
|
+
- name: Install dependencies
|
|
47
|
+
run: |
|
|
48
|
+
apt-get update
|
|
49
|
+
apt-get install -y --no-install-recommends \
|
|
50
|
+
python3-matplotlib \
|
|
51
|
+
python3-numpy \
|
|
52
|
+
python3-pandas \
|
|
53
|
+
python3-requests \
|
|
54
|
+
python3-scipy \
|
|
55
|
+
python3-soundfile \
|
|
56
|
+
python3-pytest \
|
|
57
|
+
git
|
|
58
|
+
python3 --version
|
|
59
|
+
# Note: "actions/checkout@v2" requires libstdc++6:amd64 to be
|
|
60
|
+
# installed in the container. To keep things simple, use
|
|
61
|
+
# "actions/checkout@v1" instead.
|
|
62
|
+
# https://github.com/actions/checkout/issues/334
|
|
63
|
+
- uses: actions/checkout@v1
|
|
64
|
+
- name: Run tests
|
|
65
|
+
run: pytest-3
|
wfdb-4.2.0/.gitignore
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# For private use
|
|
2
|
+
private-tests.ipynb
|
|
3
|
+
notes.md
|
|
4
|
+
|
|
5
|
+
# Byte-compiled / optimized / DLL files
|
|
6
|
+
__pycache__/
|
|
7
|
+
*.py[cod]
|
|
8
|
+
*$py.class
|
|
9
|
+
|
|
10
|
+
# C extensions
|
|
11
|
+
*.so
|
|
12
|
+
|
|
13
|
+
# Distribution / packaging
|
|
14
|
+
.Python
|
|
15
|
+
.vscode
|
|
16
|
+
venv/
|
|
17
|
+
env/
|
|
18
|
+
build/
|
|
19
|
+
develop-eggs/
|
|
20
|
+
dist/
|
|
21
|
+
downloads/
|
|
22
|
+
eggs/
|
|
23
|
+
.eggs/
|
|
24
|
+
lib/
|
|
25
|
+
lib64/
|
|
26
|
+
parts/
|
|
27
|
+
sdist/
|
|
28
|
+
var/
|
|
29
|
+
*.egg-info/
|
|
30
|
+
.installed.cfg
|
|
31
|
+
*.egg
|
|
32
|
+
|
|
33
|
+
# PyInstaller
|
|
34
|
+
# Usually these files are written by a python script from a template
|
|
35
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
36
|
+
*.manifest
|
|
37
|
+
*.spec
|
|
38
|
+
|
|
39
|
+
# Installer logs
|
|
40
|
+
pip-log.txt
|
|
41
|
+
pip-delete-this-directory.txt
|
|
42
|
+
|
|
43
|
+
# Unit test / coverage reports
|
|
44
|
+
htmlcov/
|
|
45
|
+
.tox/
|
|
46
|
+
.coverage
|
|
47
|
+
.coverage.*
|
|
48
|
+
.cache
|
|
49
|
+
nosetests.xml
|
|
50
|
+
coverage.xml
|
|
51
|
+
*,cover
|
|
52
|
+
.hypothesis/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
|
|
61
|
+
# Sphinx documentation
|
|
62
|
+
docs/_build/
|
|
63
|
+
|
|
64
|
+
# PyBuilder
|
|
65
|
+
target/
|
|
66
|
+
|
|
67
|
+
#Ipython Notebook
|
|
68
|
+
.ipynb_checkpoints
|
|
69
|
+
|
|
70
|
+
# OSX .DS_Store
|
|
71
|
+
.DS_Store
|
|
72
|
+
|
|
73
|
+
# pyenv
|
|
74
|
+
.python-version
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# File: .readthedocs.yaml
|
|
2
|
+
|
|
3
|
+
version: 2
|
|
4
|
+
|
|
5
|
+
build:
|
|
6
|
+
os: "ubuntu-20.04"
|
|
7
|
+
tools:
|
|
8
|
+
python: "3.10"
|
|
9
|
+
|
|
10
|
+
# Build from the docs/ directory with Sphinx
|
|
11
|
+
sphinx:
|
|
12
|
+
configuration: docs/conf.py
|
|
13
|
+
|
|
14
|
+
# Explicitly set the version of Python and its requirements
|
|
15
|
+
python:
|
|
16
|
+
install:
|
|
17
|
+
- requirements: docs/requirements.txt
|
wfdb-4.2.0/DEVELOPING.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Developing WFDB-Python
|
|
2
|
+
|
|
3
|
+
## Guidelines
|
|
4
|
+
|
|
5
|
+
We welcome community contributions in the form of pull requests. When contributing code, please ensure:
|
|
6
|
+
|
|
7
|
+
- Documentation is provided. New functions and classes should have numpy/scipy style [docstrings](https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt).
|
|
8
|
+
- Unit tests are written for new features that are not covered by [existing tests](https://github.com/MIT-LCP/wfdb-python/tree/main/tests).
|
|
9
|
+
- The code style is consistent with the project's formating standards.
|
|
10
|
+
|
|
11
|
+
Run the formatter with:
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
black .
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Package and Dependency Management
|
|
18
|
+
|
|
19
|
+
This project uses [uv](https://docs.astral.sh/uv/) for package management and distribution.
|
|
20
|
+
|
|
21
|
+
Development dependencies are specified as optional dependencies, at least for now and until [development dependencies](https://docs.astral.sh/uv/concepts/dependencies/#development-dependencies) become more widely used.
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
uv add <somepackage> --optional <somegroup>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Creating Distributions
|
|
28
|
+
|
|
29
|
+
1. Bump the version in [version.py](./wfdb/version.py).
|
|
30
|
+
|
|
31
|
+
2. Add a summary of the changes to [the changelog](https://github.com/MIT-LCP/wfdb-python/blob/main/docs/changes.rst). You may also need to update [the documentation](https://github.com/MIT-LCP/wfdb-python/tree/main/docs). For example, if function arguments have been updated, this change will need to be captured. Open a pull request to merge these changes to the main branch.
|
|
32
|
+
|
|
33
|
+
3. After the pull requests above have been merged, go to https://github.com/MIT-LCP/wfdb-python/releases and click "Draft new release" to create a new tag/release of the package. Set the tag to the new version number and draft the release notes (or click "Generate release notes"!).
|
|
34
|
+
|
|
35
|
+
4. Publish the project to PyPI, the [Python Package Index](https://pypi.org/project/wfdb/).
|
|
36
|
+
|
|
37
|
+
It may be useful to publish to testpypi and preview the changes before publishing to PyPi. However, the project dependencies likely will not be available when trying to install from there.
|
|
38
|
+
|
|
39
|
+
Setup: configure access to repositories:
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
# Create an API token, then add it
|
|
43
|
+
poetry config pypi-token.pypi <my-token>
|
|
44
|
+
|
|
45
|
+
# For testpypi
|
|
46
|
+
poetry config repositories.test-pypi https://test.pypi.org/legacy/
|
|
47
|
+
poetry config pypi-token.test-pypi <my-testpypi-token>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
To build and upload a new distribution:
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
uv build
|
|
54
|
+
|
|
55
|
+
uv publish --publish-url https://test.pypi.org/legacy/
|
|
56
|
+
uv publish
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Creating Documentation
|
|
60
|
+
|
|
61
|
+
The project's documentation is generated by [Sphinx](https://docs.readthedocs.io/en/stable/intro/getting-started-with-sphinx.html) using the content in the [docs](./docs) directory. The generated content is then hosted on readthedocs (RTD) at: <http://wfdb.readthedocs.io>
|
|
62
|
+
|
|
63
|
+
To manage the content on RTD, request yourself to be added to the [wfdb](https://readthedocs.org/projects/wfdb/) project. The project has already been configured to import content from the GitHub repository. Documentation for new releases should be automatically built and uploaded. See the [import guide](https://docs.readthedocs.io/en/stable/intro/import-guide.html) for more details.
|
|
64
|
+
|
|
65
|
+
There is some redundancy in specifying the Sphinx requirements between pyproject.toml and [docs/requirements.txt](./docs/requirements.txt), the latter of which is used by RTD. Make sure that the content is consistent across the two files.
|
|
66
|
+
|
|
67
|
+
To generate the HTML content locally, install the required dependencies and run from the `docs` directory:
|
|
68
|
+
|
|
69
|
+
```sh
|
|
70
|
+
make html
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Tests
|
|
74
|
+
|
|
75
|
+
Run tests using pytest:
|
|
76
|
+
|
|
77
|
+
```sh
|
|
78
|
+
pytest
|
|
79
|
+
# Distribute tests across multiple cores.
|
|
80
|
+
# https://github.com/pytest-dev/pytest-xdist
|
|
81
|
+
pytest -n auto
|
|
82
|
+
```
|
|
@@ -1,33 +1,26 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: wfdb
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.2.0
|
|
4
4
|
Summary: The WFDB Python package: tools for reading, writing, and processing physiologic signals and annotations.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Author-email: contact@physionet.org
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
Project-URL: homepage, https://github.com/MIT-LCP/wfdb-python/
|
|
6
|
+
Project-URL: repository, https://github.com/MIT-LCP/wfdb-python/
|
|
7
|
+
Project-URL: documentation, https://wfdb.readthedocs.io/
|
|
8
|
+
Author-email: The Laboratory for Computational Physiology <contact@physionet.org>
|
|
9
|
+
License: MIT License
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Requires-Python: >=3.9
|
|
12
|
+
Requires-Dist: matplotlib>=3.2.2
|
|
13
|
+
Requires-Dist: numpy>=1.26.4
|
|
14
|
+
Requires-Dist: pandas>=2.2.3
|
|
15
|
+
Requires-Dist: requests>=2.8.1
|
|
16
|
+
Requires-Dist: scipy>=1.13.0
|
|
17
|
+
Requires-Dist: soundfile>=0.10.0
|
|
17
18
|
Provides-Extra: dev
|
|
18
|
-
Requires-Dist:
|
|
19
|
-
Requires-Dist:
|
|
20
|
-
Requires-Dist:
|
|
21
|
-
Requires-Dist:
|
|
22
|
-
Requires-Dist:
|
|
23
|
-
Requires-Dist: pandas (>=1.3.0)
|
|
24
|
-
Requires-Dist: pylint (>=2.13.7) ; extra == "dev"
|
|
25
|
-
Requires-Dist: pytest (>=7.1.1) ; extra == "dev"
|
|
26
|
-
Requires-Dist: pytest-xdist (>=2.5.0) ; extra == "dev"
|
|
27
|
-
Requires-Dist: requests (>=2.8.1)
|
|
28
|
-
Requires-Dist: scipy (>=1.0.0)
|
|
29
|
-
Project-URL: Documentation, https://wfdb.readthedocs.io/
|
|
30
|
-
Project-URL: Repository, https://github.com/MIT-LCP/wfdb-python/
|
|
19
|
+
Requires-Dist: black>=22.3.0; extra == 'dev'
|
|
20
|
+
Requires-Dist: pylint>=2.13.7; extra == 'dev'
|
|
21
|
+
Requires-Dist: pytest-xdist>=2.5.0; extra == 'dev'
|
|
22
|
+
Requires-Dist: pytest>=7.1.1; extra == 'dev'
|
|
23
|
+
Requires-Dist: sphinx>=4.5.0; extra == 'dev'
|
|
31
24
|
Description-Content-Type: text/markdown
|
|
32
25
|
|
|
33
26
|
# The WFDB Python Package
|
|
@@ -53,37 +46,34 @@ See the [demo.ipynb](https://github.com/MIT-LCP/wfdb-python/blob/main/demo.ipynb
|
|
|
53
46
|
|
|
54
47
|
## Installation
|
|
55
48
|
|
|
56
|
-
The distribution is hosted on PyPI at: <https://pypi.python.org/pypi/wfdb/>. The package can be directly installed from PyPI using
|
|
49
|
+
The distribution is hosted on PyPI at: <https://pypi.python.org/pypi/wfdb/>. The package can be directly installed from PyPI using pip:
|
|
57
50
|
|
|
58
51
|
```sh
|
|
59
52
|
pip install wfdb
|
|
60
|
-
poetry add wfdb
|
|
61
53
|
```
|
|
62
54
|
|
|
63
|
-
On
|
|
55
|
+
On some less-common systems, you may need to install `libsndfile` separately. See the [soundfile installation notes](https://pypi.org/project/soundfile/) for more information.
|
|
64
56
|
|
|
65
57
|
The development version is hosted at: <https://github.com/MIT-LCP/wfdb-python>. This repository also contains demo scripts and example data. To install the development version, clone or download the repository, navigate to the base directory, and run:
|
|
66
58
|
|
|
67
59
|
```sh
|
|
68
|
-
# Without dev dependencies
|
|
69
60
|
pip install .
|
|
70
|
-
|
|
61
|
+
```
|
|
71
62
|
|
|
72
|
-
|
|
73
|
-
pip install ".[dev]"
|
|
74
|
-
poetry install -E dev
|
|
63
|
+
If you intend to make changes to the repository, you can install additional packages that are useful for development by running:
|
|
75
64
|
|
|
76
|
-
|
|
77
|
-
|
|
65
|
+
```sh
|
|
66
|
+
pip install ".[dev]"
|
|
78
67
|
```
|
|
79
68
|
|
|
80
|
-
**See the [note](https://github.com/MIT-LCP/wfdb-python/blob/main/DEVELOPING.md#package-and-dependency-management) about dev dependencies.**
|
|
81
|
-
|
|
82
69
|
## Developing
|
|
83
70
|
|
|
84
71
|
Please see the [DEVELOPING.md](https://github.com/MIT-LCP/wfdb-python/blob/main/DEVELOPING.md) document for contribution/development instructions.
|
|
85
72
|
|
|
73
|
+
### Creating a new release
|
|
74
|
+
|
|
75
|
+
For guidance on creating a new release, see: https://github.com/MIT-LCP/wfdb-python/blob/main/DEVELOPING.md#creating-distributions
|
|
76
|
+
|
|
86
77
|
## Citing
|
|
87
78
|
|
|
88
79
|
When using this resource, please cite the software [publication](https://physionet.org/content/wfdb-python/) on PhysioNet.
|
|
89
|
-
|
|
@@ -21,36 +21,34 @@ See the [demo.ipynb](https://github.com/MIT-LCP/wfdb-python/blob/main/demo.ipynb
|
|
|
21
21
|
|
|
22
22
|
## Installation
|
|
23
23
|
|
|
24
|
-
The distribution is hosted on PyPI at: <https://pypi.python.org/pypi/wfdb/>. The package can be directly installed from PyPI using
|
|
24
|
+
The distribution is hosted on PyPI at: <https://pypi.python.org/pypi/wfdb/>. The package can be directly installed from PyPI using pip:
|
|
25
25
|
|
|
26
26
|
```sh
|
|
27
27
|
pip install wfdb
|
|
28
|
-
poetry add wfdb
|
|
29
28
|
```
|
|
30
29
|
|
|
31
|
-
On
|
|
30
|
+
On some less-common systems, you may need to install `libsndfile` separately. See the [soundfile installation notes](https://pypi.org/project/soundfile/) for more information.
|
|
32
31
|
|
|
33
32
|
The development version is hosted at: <https://github.com/MIT-LCP/wfdb-python>. This repository also contains demo scripts and example data. To install the development version, clone or download the repository, navigate to the base directory, and run:
|
|
34
33
|
|
|
35
34
|
```sh
|
|
36
|
-
# Without dev dependencies
|
|
37
35
|
pip install .
|
|
38
|
-
|
|
36
|
+
```
|
|
39
37
|
|
|
40
|
-
|
|
41
|
-
pip install ".[dev]"
|
|
42
|
-
poetry install -E dev
|
|
38
|
+
If you intend to make changes to the repository, you can install additional packages that are useful for development by running:
|
|
43
39
|
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
```sh
|
|
41
|
+
pip install ".[dev]"
|
|
46
42
|
```
|
|
47
43
|
|
|
48
|
-
**See the [note](https://github.com/MIT-LCP/wfdb-python/blob/main/DEVELOPING.md#package-and-dependency-management) about dev dependencies.**
|
|
49
|
-
|
|
50
44
|
## Developing
|
|
51
45
|
|
|
52
46
|
Please see the [DEVELOPING.md](https://github.com/MIT-LCP/wfdb-python/blob/main/DEVELOPING.md) document for contribution/development instructions.
|
|
53
47
|
|
|
48
|
+
### Creating a new release
|
|
49
|
+
|
|
50
|
+
For guidance on creating a new release, see: https://github.com/MIT-LCP/wfdb-python/blob/main/DEVELOPING.md#creating-distributions
|
|
51
|
+
|
|
54
52
|
## Citing
|
|
55
53
|
|
|
56
54
|
When using this resource, please cite the software [publication](https://physionet.org/content/wfdb-python/) on PhysioNet.
|
wfdb-4.2.0/activate
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# This file must be used with "source bin/activate" *from bash*
|
|
2
|
+
# you cannot run it directly
|
|
3
|
+
|
|
4
|
+
deactivate () {
|
|
5
|
+
# reset old environment variables
|
|
6
|
+
if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then
|
|
7
|
+
PATH="${_OLD_VIRTUAL_PATH:-}"
|
|
8
|
+
export PATH
|
|
9
|
+
unset _OLD_VIRTUAL_PATH
|
|
10
|
+
fi
|
|
11
|
+
if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then
|
|
12
|
+
PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}"
|
|
13
|
+
export PYTHONHOME
|
|
14
|
+
unset _OLD_VIRTUAL_PYTHONHOME
|
|
15
|
+
fi
|
|
16
|
+
|
|
17
|
+
# This should detect bash and zsh, which have a hash command that must
|
|
18
|
+
# be called to get it to forget past commands. Without forgetting
|
|
19
|
+
# past commands the $PATH changes we made may not be respected
|
|
20
|
+
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
|
|
21
|
+
hash -r 2> /dev/null
|
|
22
|
+
fi
|
|
23
|
+
|
|
24
|
+
if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then
|
|
25
|
+
PS1="${_OLD_VIRTUAL_PS1:-}"
|
|
26
|
+
export PS1
|
|
27
|
+
unset _OLD_VIRTUAL_PS1
|
|
28
|
+
fi
|
|
29
|
+
|
|
30
|
+
unset VIRTUAL_ENV
|
|
31
|
+
if [ ! "${1:-}" = "nondestructive" ] ; then
|
|
32
|
+
# Self destruct!
|
|
33
|
+
unset -f deactivate
|
|
34
|
+
fi
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
# unset irrelevant variables
|
|
38
|
+
deactivate nondestructive
|
|
39
|
+
|
|
40
|
+
VIRTUAL_ENV="/Users/tompollard/projects/wfdb-python/env"
|
|
41
|
+
export VIRTUAL_ENV
|
|
42
|
+
|
|
43
|
+
_OLD_VIRTUAL_PATH="$PATH"
|
|
44
|
+
PATH="$VIRTUAL_ENV/bin:$PATH"
|
|
45
|
+
export PATH
|
|
46
|
+
|
|
47
|
+
# unset PYTHONHOME if set
|
|
48
|
+
# this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
|
|
49
|
+
# could use `if (set -u; : $PYTHONHOME) ;` in bash
|
|
50
|
+
if [ -n "${PYTHONHOME:-}" ] ; then
|
|
51
|
+
_OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}"
|
|
52
|
+
unset PYTHONHOME
|
|
53
|
+
fi
|
|
54
|
+
|
|
55
|
+
if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
|
|
56
|
+
_OLD_VIRTUAL_PS1="${PS1:-}"
|
|
57
|
+
PS1="(env) ${PS1:-}"
|
|
58
|
+
export PS1
|
|
59
|
+
fi
|
|
60
|
+
|
|
61
|
+
# This should detect bash and zsh, which have a hash command that must
|
|
62
|
+
# be called to get it to forget past commands. Without forgetting
|
|
63
|
+
# past commands the $PATH changes we made may not be respected
|
|
64
|
+
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
|
|
65
|
+
hash -r 2> /dev/null
|
|
66
|
+
fi
|
wfdb-4.2.0/docs/Makefile
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Minimal makefile for Sphinx documentation
|
|
2
|
+
#
|
|
3
|
+
|
|
4
|
+
# You can set these variables from the command line.
|
|
5
|
+
SPHINXOPTS =
|
|
6
|
+
SPHINXBUILD = sphinx-build
|
|
7
|
+
SPHINXPROJ = wfdb
|
|
8
|
+
SOURCEDIR = .
|
|
9
|
+
BUILDDIR = _build
|
|
10
|
+
|
|
11
|
+
# Put it first so that "make" without argument is like "make help".
|
|
12
|
+
help:
|
|
13
|
+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
14
|
+
|
|
15
|
+
.PHONY: help Makefile
|
|
16
|
+
|
|
17
|
+
# Catch-all target: route all unknown targets to Sphinx using the new
|
|
18
|
+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
|
19
|
+
%: Makefile
|
|
20
|
+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
Recent Changes
|
|
2
|
+
==============
|
|
3
|
+
|
|
4
|
+
This page lists recent changes in the `wfdb` package (since version 4.0.0) that may be relevant if you are upgrading from an older version of the package. For the complete history of changes in the package, please refer to the `development repository`_ on GitHub.
|
|
5
|
+
|
|
6
|
+
.. _development repository: https://github.com/MIT-LCP/wfdb-python
|
|
7
|
+
|
|
8
|
+
Version 4.2.0 (Jan 2025)
|
|
9
|
+
-----------------------------
|
|
10
|
+
|
|
11
|
+
**Add support for Numpy 2.0**
|
|
12
|
+
Fixes were added to address [changes to type promotion](https://numpy.org/devdocs/numpy_2_0_migration_guide.html#changes-to-numpy-data-type-promotion) that led to overflow errors (e.g. https://github.com/MIT-LCP/wfdb-python/issues/493).
|
|
13
|
+
|
|
14
|
+
**Fix UnboundLocalError in GQRS algorithm**
|
|
15
|
+
Fixes the GQRS algorithm to address an `UnboundLocalError`.
|
|
16
|
+
|
|
17
|
+
**Support write directory in `csv_to_wfdb`**
|
|
18
|
+
`write_dir` can now be specified when calling `csv_to_wfdb`.
|
|
19
|
+
|
|
20
|
+
**Use uv for for package management**
|
|
21
|
+
Moves package management from poetry to uv.
|
|
22
|
+
|
|
23
|
+
**Fix misordered arguments in `util.lines_to_file`**
|
|
24
|
+
Fixes misordered arguments in `util.lines_to_file`.
|
|
25
|
+
|
|
26
|
+
**Allow signals to be written with unique samples per frame**
|
|
27
|
+
Adds capability to write signal with unique samps_per_frame to `wfdb.io.wrsamp`.
|
|
28
|
+
|
|
29
|
+
**Allow expanded physical signal in `calc_adc_params`**
|
|
30
|
+
Updates `calc_adc_params` to allow an expanded physical signal to be passed. Previously only a non-expanded signal was allowed.
|
|
31
|
+
|
|
32
|
+
**Allow selection of channels when converting to EDF**
|
|
33
|
+
Fixes the `wfdb-to_edf()` function to support an optional channels argument.
|
|
34
|
+
|
|
35
|
+
**Migrates Ricker wavelet from SciPy to WFDB after deprecation**
|
|
36
|
+
The Ricker wavelet (`scipy.signal.ricker`) was removed in SciPy v1.15, so the original implementation was migrated to the WFDB package.
|
|
37
|
+
|
|
38
|
+
**Miscellaneous style and typing fixes**
|
|
39
|
+
Various fixes were made to code style and handling of data types.
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
Version 4.1.2 (June 2023)
|
|
43
|
+
-----------------------------
|
|
44
|
+
|
|
45
|
+
**Handle more than 8 compressed signals in wrsamp**
|
|
46
|
+
Previously, the package did not support writing of compressed records with more than 8 channels.
|
|
47
|
+
|
|
48
|
+
**Use int64 instead of int for ann2rr**
|
|
49
|
+
Fixes 'np has no attribute np.int' error raised when running ann2rr.
|
|
50
|
+
|
|
51
|
+
Version 4.1.1 (April 2023)
|
|
52
|
+
-----------------------------
|
|
53
|
+
|
|
54
|
+
**Remove upper bound on dependencies**
|
|
55
|
+
Previously, the package provided restrictive caps on version number of dependencies. These caps have been removed.
|
|
56
|
+
|
|
57
|
+
**Miscellaneous style and typing fixes**
|
|
58
|
+
Various fixes were made to code style and handling of data types.
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
Version 4.1.0 (December 2022)
|
|
62
|
+
-----------------------------
|
|
63
|
+
|
|
64
|
+
**Converting a record into a DataFrame**
|
|
65
|
+
The new method :meth:`wfdb.Record.to_dataframe` can be used to convert signal data from a Record object into a Pandas DataFrame, which can then be manipulated using Pandas methods.
|
|
66
|
+
|
|
67
|
+
**Locating signals in a multi-segment record**
|
|
68
|
+
The new method :meth:`wfdb.MultiRecord.contained_ranges` can be used to search for time intervals within a record that contain a specific channel. The method :meth:`wfdb.MultiRecord.contained_combined_ranges` searches for time intervals that contain several specific channels at once.
|
|
69
|
+
|
|
70
|
+
**Writing custom annotation symbols**
|
|
71
|
+
The :func:`wfdb.wrann` function can now be used to write annotations with custom annotation types (``symbol`` strings.) Custom annotation types must be defined using the ``custom_labels`` argument.
|
|
72
|
+
|
|
73
|
+
**Correct rounding when converting floating-point signal data**
|
|
74
|
+
When calling :func:`wfdb.wrsamp` with a ``p_signal`` argument, input values will be *rounded* to the nearest sample value rather than being *truncated* towards zero. The same applies to the :meth:`wfdb.Record.adc` method.
|
|
75
|
+
|
|
76
|
+
**Writing signals in compressed format**
|
|
77
|
+
The :func:`wfdb.wrsamp` function, and the :meth:`wfdb.Record.wrsamp` method, now support writing compressed signal files. To write a compressed file, set the ``fmt`` value to ``"508"`` (for an 8-bit channel), ``"516"`` (for a 16-bit channel), or ``"524"`` (for a 24-bit channel).
|
|
78
|
+
|
|
79
|
+
**Decoding non-ASCII text in EDF files**
|
|
80
|
+
The :func:`wfdb.io.convert.edf.read_edf` and :func:`wfdb.io.convert.edf.rdedfann` functions now take an optional argument ``encoding``, which specifies the character encoding for text fields. ISO-8859-1 encoding is used by default, in contrast to older versions of the package which used UTF-8.
|
|
81
|
+
|
|
82
|
+
**Bug fixes when writing signal metadata**
|
|
83
|
+
When calling :meth:`wfdb.Record.wrsamp`, the checksum and samples-per-frame fields in the header file will correctly match the signal data, rather than relying on attributes of the Record object.
|