Skip to main content

A python package to benchmark different pre-ejection period (PEP) extraction algorithms.

Project description

PEPbench - The python package for automated pre-ejection period (PEP) extraction algorithms.

PyPI GitHub Documentation Status Test and Lint codecov Code style: black PyPI - Downloads GitHub commit activity

pepbench presents a framework for the automated extraction of the pre-ejection period (PEP) from electrocardiogram (ECG) and impedance cardiography (ICG) signals. The package includes a variety of algorithms for PEP extraction, as well as tools for the evaluation of these algorithms.

Documentation: pepbench.readthedocs.io

Installation

First install a supported Python version (3.10 or higher) and then install the package using pip.

pip install pepbench

Installing from GitHub

If you want to install the latest version from GitHub, you can use the following command:

pip install "git+https://github.com/empkins/pepbench.git"

If you run into problems, clone the repository and install the package locally.

git clone https://github.com/empkins/pepbench.git
cd pepbench
pip install .

Note: We don't guarantee that the latest version on GitHub is stable.

Usage Recommendation

pepbench is designed to be used in the following ways:

  1. Usage as a full end-to-end pipeline:
    We provide configurable pipelines to extract the PEP per-heartbeat from ECG and ICG signals. The exact configuration of the pipeline (i.e., which algorithm combinations are used) depend on the dataset and can be adjusted to the specific use case. A systematic evaluation of different algorithm combinations is subject to the paper "PEPbench – Open, Reproducible, and Systematic Benchmarking of Automated Pre-Ejection Period Extraction Algorithms".

    In this case, we recommend to cite the paper and the package as follows:

    PEP extraction was performed using the pepbench Python library pipeline (version {insert version you used}) as described in the paper [[1]] with the Q-peak extraction proposed by Martinez et al. [[2]] and the B-point extraction algorithm proposed by Drost et al. [[3]].

    [1] <pepbench citation>
    [2] Martinez, J. P., Almeida, R., Olmos, S., Rocha, A. P., & Laguna, P. (2004). A wavelet-based ECG delineator
    evaluation on standard databases. IEEE Transactions on Biomedical Engineering, 51(4), 570-581.
    https://doi.org/10.1109/TBME.2003.821031
    [3] Drost, L., Finke, J. B., Port, J., & Schächinger, H. (2022). Comparison of TWA and PEP as indices of a2- and
    ß-adrenergic activation. Psychopharmacology. https://doi.org/10.1007/s00213-022-06114-8
    
  2. Usage of individual algorithms: If you are only interested in a specific algorithm, you can use the individual algorithms provided in the package. If you are using individual algorithms in this way, we recommend citing the original papers the algorithms were proposed in and pepbench as a software library. You can find the best references for each algorithm in the documentation of the respective algorithm.

    B-points were extracted using the{name of algorithm} algorithm [[1]] as implemented in the pepbench Python library [[2]] (version {insert version you used}).

    [1] <algorithm citation>
    [2] <pepbench citation>
    

Contributing

We want to hear from you (and we want your algorithms)!

👍 We are always happy to receive feedback and contributions. If you run into any issues or have any questions, please open an issue on GitHub or start a discussions thread.

📚 If you are using pepbench in your research or project, we would love to hear about it and link your work here!

💻 And most importantly, we want your algorithms! If you have an algorithm that you think would be a good fit for pepbench, open an issue, and we can discuss how to integrate it. We are happy to help you with the integration process. Even if you are not confident in your Python skills, we can discuss ways to get your algorithm into pepbench.

License

pepbench (and biopsykit, which contains the core algorithm implementations) are published under a MIT license. This is a permissive license, which allows you to use the code in nearly any way you want, as long as you include the original license in you modified version.

For Developers

Install Python >=3.10 and uv. Then run the commands below to install poethepoet, get the latest source, and install the dependencies:

git clone https://github.com/empkins/pepbench.git
uv tool install poethepoet
cd pepbench
uv sync --all-extras --dev

All dependencies are specified in the main pyproject.toml when running uv sync.

To run any of the tools required for the development workflow, use the provided poethepoet commands:

uv run poe
...
CONFIGURED TASKS
  format            Format all files with black.
  lint              Lint all files with ruff.
  check             Check all potential format and linting issues.
  test              Run Pytest with coverage.
  docs              Build the html docs using Sphinx.
  conf_jupyter      Register the pepbench environment as a Jupyter kernel for testing.
  version           Bump version in all relevant places.

Format and Linting

To ensure consistent code structure this project uses black and ruff to automatically check (and fix) the code format.

poe format  # runs ruff format and ruff lint with the autofix flag
poe lint # runs ruff without autofix (will show issues that can not automatically be fixed)

If you want to check if all code follows the code guidelines, run poe ci_check. This can be useful in the CI context.

Tests

All tests are located in the tests folder and can be executed by using poe test.

Funding and Support

This work was developed within the Empkins collaborative research center (SFB 1483) funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) - Project-ID 442419336, EmpkinS.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pepbench-0.2.0.tar.gz (79.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pepbench-0.2.0-py3-none-any.whl (107.2 kB view details)

Uploaded Python 3

File details

Details for the file pepbench-0.2.0.tar.gz.

File metadata

  • Download URL: pepbench-0.2.0.tar.gz
  • Upload date:
  • Size: 79.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pepbench-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b089bc8bfcd2eeaedfe6e2b79a3076c2ef40f11dc633ecb662640b1ecd1e4567
MD5 4f240e82ecd856eed4cb83d240501f82
BLAKE2b-256 42230c1bc331bc08a147ee4240f819ecb0996de45eba89e4bbe8e4c95ed863ca

See more details on using hashes here.

Provenance

The following attestation bundles were made for pepbench-0.2.0.tar.gz:

Publisher: publish.yml on empkins/pepbench

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pepbench-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pepbench-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 107.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pepbench-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dbc57488c576c6c7dfef78ff4a8587438d4646814e2397fac8d982542d831c17
MD5 addd5a14cd16ae62ffab83c696eb34f5
BLAKE2b-256 f120a8dcdf050564d4b1da29cc3cab17364219c4d22db77fc1a2ae06163bee61

See more details on using hashes here.

Provenance

The following attestation bundles were made for pepbench-0.2.0-py3-none-any.whl:

Publisher: publish.yml on empkins/pepbench

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page