pepbench 0.1.1__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.
Files changed (54) hide show
  1. pepbench-0.1.1/.gitignore +245 -0
  2. pepbench-0.1.1/LICENSE +21 -0
  3. pepbench-0.1.1/PKG-INFO +179 -0
  4. pepbench-0.1.1/README.md +164 -0
  5. pepbench-0.1.1/pyproject.toml +97 -0
  6. pepbench-0.1.1/src/pepbench/__init__.py +7 -0
  7. pepbench-0.1.1/src/pepbench/_docutils.py +64 -0
  8. pepbench-0.1.1/src/pepbench/algorithms/__init__.py +16 -0
  9. pepbench-0.1.1/src/pepbench/algorithms/ecg.py +13 -0
  10. pepbench-0.1.1/src/pepbench/algorithms/heartbeat_segmentation.py +5 -0
  11. pepbench-0.1.1/src/pepbench/algorithms/icg.py +29 -0
  12. pepbench-0.1.1/src/pepbench/algorithms/outlier_correction.py +9 -0
  13. pepbench-0.1.1/src/pepbench/data_handling/__init__.py +33 -0
  14. pepbench-0.1.1/src/pepbench/data_handling/_data_handling.py +388 -0
  15. pepbench-0.1.1/src/pepbench/data_handling/utils.py +116 -0
  16. pepbench-0.1.1/src/pepbench/datasets/__init__.py +49 -0
  17. pepbench-0.1.1/src/pepbench/datasets/_base_pep_extraction_dataset.py +253 -0
  18. pepbench-0.1.1/src/pepbench/datasets/_example_dataset.py +150 -0
  19. pepbench-0.1.1/src/pepbench/datasets/_helper.py +128 -0
  20. pepbench-0.1.1/src/pepbench/datasets/empkins/__init__.py +5 -0
  21. pepbench-0.1.1/src/pepbench/datasets/empkins/_dataset.py +480 -0
  22. pepbench-0.1.1/src/pepbench/datasets/empkins/_helper.py +43 -0
  23. pepbench-0.1.1/src/pepbench/datasets/guardian/__init__.py +5 -0
  24. pepbench-0.1.1/src/pepbench/datasets/guardian/_dataset.py +459 -0
  25. pepbench-0.1.1/src/pepbench/datasets/guardian/_helper.py +9 -0
  26. pepbench-0.1.1/src/pepbench/datasets/guardian/_tfm_loader.py +204 -0
  27. pepbench-0.1.1/src/pepbench/evaluation/__init__.py +18 -0
  28. pepbench-0.1.1/src/pepbench/evaluation/_error_metrics.py +86 -0
  29. pepbench-0.1.1/src/pepbench/evaluation/_evaluation.py +227 -0
  30. pepbench-0.1.1/src/pepbench/evaluation/_scoring.py +257 -0
  31. pepbench-0.1.1/src/pepbench/evaluation/_scoring_aggregator.py +18 -0
  32. pepbench-0.1.1/src/pepbench/example_data.py +92 -0
  33. pepbench-0.1.1/src/pepbench/export/__init__.py +17 -0
  34. pepbench-0.1.1/src/pepbench/export/_latex.py +161 -0
  35. pepbench-0.1.1/src/pepbench/heartbeat_matching/__init__.py +5 -0
  36. pepbench-0.1.1/src/pepbench/heartbeat_matching/_heartbeat_matching.py +276 -0
  37. pepbench-0.1.1/src/pepbench/io/__init__.py +5 -0
  38. pepbench-0.1.1/src/pepbench/io/_io.py +124 -0
  39. pepbench-0.1.1/src/pepbench/pipelines/__init__.py +27 -0
  40. pepbench-0.1.1/src/pepbench/pipelines/_base_pipeline.py +187 -0
  41. pepbench-0.1.1/src/pepbench/pipelines/_pipeline.py +118 -0
  42. pepbench-0.1.1/src/pepbench/pipelines/_pipeline_reference_b_point.py +115 -0
  43. pepbench-0.1.1/src/pepbench/pipelines/_pipeline_reference_q_peak.py +122 -0
  44. pepbench-0.1.1/src/pepbench/plotting/__init__.py +24 -0
  45. pepbench-0.1.1/src/pepbench/plotting/_base_plotting.py +1005 -0
  46. pepbench-0.1.1/src/pepbench/plotting/_utils.py +618 -0
  47. pepbench-0.1.1/src/pepbench/plotting/algorithms.py +2807 -0
  48. pepbench-0.1.1/src/pepbench/plotting/results.py +917 -0
  49. pepbench-0.1.1/src/pepbench/utils/__init__.py +6 -0
  50. pepbench-0.1.1/src/pepbench/utils/_rename_maps.py +96 -0
  51. pepbench-0.1.1/src/pepbench/utils/_timing.py +33 -0
  52. pepbench-0.1.1/src/pepbench/utils/_types.py +24 -0
  53. pepbench-0.1.1/src/pepbench/utils/exceptions.py +7 -0
  54. pepbench-0.1.1/src/pepbench/utils/styling.py +91 -0
@@ -0,0 +1,245 @@
1
+ # ignore local config file that specifies local paths
2
+ config.json
3
+ paper_path.json
4
+ *_timing_information.json
5
+
6
+ # ignore playground folder
7
+ playground
8
+
9
+ # ignore local cachedir
10
+ cachedir
11
+
12
+ .ipynb_checkpoints
13
+ */.ipynb_checkpoints/*
14
+
15
+ # IPython
16
+ profile_default/
17
+ ipython_config.py
18
+
19
+ # Remove previous ipynb_checkpoints
20
+ # git rm -r .ipynb_checkpoints/
21
+
22
+ ### Linux ###
23
+ *~
24
+
25
+ # temporary files which can be created if a process still has a handle open of a deleted file
26
+ .fuse_hidden*
27
+
28
+ # KDE directory preferences
29
+ .directory
30
+
31
+ # Linux trash folder which might appear on any partition or disk
32
+ .Trash-*
33
+
34
+ # .nfs files are created when an open file is removed but is still being accessed
35
+ .nfs*
36
+
37
+ ### macOS ###
38
+ # General
39
+ .DS_Store
40
+ .AppleDouble
41
+ .LSOverride
42
+
43
+ # Icon must end with two \r
44
+ Icon
45
+
46
+
47
+ # Thumbnails
48
+ ._*
49
+
50
+ # Files that might appear in the root of a volume
51
+ .DocumentRevisions-V100
52
+ .fseventsd
53
+ .Spotlight-V100
54
+ .TemporaryItems
55
+ .Trashes
56
+ .VolumeIcon.icns
57
+ .com.apple.timemachine.donotpresent
58
+
59
+ # Directories potentially created on remote AFP share
60
+ .AppleDB
61
+ .AppleDesktop
62
+ Network Trash Folder
63
+ Temporary Items
64
+ .apdisk
65
+
66
+ ### Python ###
67
+ # Byte-compiled / optimized / DLL files
68
+ __pycache__/
69
+ *.py[cod]
70
+ *$py.class
71
+
72
+ # C extensions
73
+ *.so
74
+
75
+ # Distribution / packaging
76
+ .Python
77
+ build/
78
+ develop-eggs/
79
+ dist/
80
+ downloads/
81
+ eggs/
82
+ .eggs/
83
+ lib/
84
+ lib64/
85
+ parts/
86
+ sdist/
87
+ var/
88
+ wheels/
89
+ share/python-wheels/
90
+ *.egg-info/
91
+ .installed.cfg
92
+ *.egg
93
+ MANIFEST
94
+
95
+ # PyInstaller
96
+ # Usually these files are written by a python script from a template
97
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
98
+ *.manifest
99
+ *.spec
100
+
101
+ # Installer logs
102
+ pip-log.txt
103
+ pip-delete-this-directory.txt
104
+
105
+ # Unit test / coverage reports
106
+ htmlcov/
107
+ .tox/
108
+ .nox/
109
+ .coverage
110
+ .coverage.*
111
+ .cache
112
+ nosetests.xml
113
+ coverage.xml
114
+ *.cover
115
+ *.py,cover
116
+ .hypothesis/
117
+ .pytest_cache/
118
+ cover/
119
+
120
+ # Translations
121
+ *.mo
122
+ *.pot
123
+
124
+ # Django stuff:
125
+ *.log
126
+ local_settings.py
127
+ db.sqlite3
128
+ db.sqlite3-journal
129
+
130
+ # Flask stuff:
131
+ instance/
132
+ .webassets-cache
133
+
134
+ # Scrapy stuff:
135
+ .scrapy
136
+
137
+ # Sphinx documentation
138
+ docs/_build/
139
+
140
+ # PyBuilder
141
+ .pybuilder/
142
+ target/
143
+
144
+ # Jupyter Notebook
145
+
146
+ # IPython
147
+
148
+ # pyenv
149
+ # For a library or package, you might want to ignore these files since the code is
150
+ # intended to run in multiple environments; otherwise, check them in:
151
+ # .python-version
152
+
153
+ # pipenv
154
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
155
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
156
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
157
+ # install all needed dependencies.
158
+ #Pipfile.lock
159
+
160
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
161
+ __pypackages__/
162
+
163
+ # Celery stuff
164
+ celerybeat-schedule
165
+ celerybeat.pid
166
+
167
+ # SageMath parsed files
168
+ *.sage.py
169
+
170
+ # Environments
171
+ .env
172
+ .venv
173
+ env/
174
+ venv/
175
+ ENV/
176
+ env.bak/
177
+ venv.bak/
178
+
179
+ # Spyder project settings
180
+ .spyderproject
181
+ .spyproject
182
+
183
+ # Rope project settings
184
+ .ropeproject
185
+
186
+ # mkdocs documentation
187
+ /site
188
+
189
+ # mypy
190
+ .mypy_cache/
191
+ .dmypy.json
192
+ dmypy.json
193
+
194
+ # Pyre type checker
195
+ .pyre/
196
+
197
+ # pytype static type analyzer
198
+ .pytype/
199
+
200
+ # Cython debug symbols
201
+ cython_debug/
202
+
203
+ ### Windows ###
204
+ # Windows thumbnail cache files
205
+ Thumbs.db
206
+ Thumbs.db:encryptable
207
+ ehthumbs.db
208
+ ehthumbs_vista.db
209
+
210
+ # Dump file
211
+ *.stackdump
212
+
213
+ # Folder config file
214
+ [Dd]esktop.ini
215
+
216
+ # Recycle Bin used on file shares
217
+ $RECYCLE.BIN/
218
+
219
+ # Windows Installer files
220
+ *.cab
221
+ *.msi
222
+ *.msix
223
+ *.msm
224
+ *.msp
225
+
226
+ # Windows shortcuts
227
+ *.lnk
228
+
229
+ # End of https://www.toptal.com/developers/gitignore/api/jupyternotebooks,linux,macos,python,windows
230
+
231
+ # Virtual env
232
+ .venv
233
+
234
+ # vscode (full)
235
+ .vscode
236
+
237
+ # PyCharm
238
+ .idea
239
+
240
+
241
+ # Pyenv
242
+ .python-version
243
+
244
+ # debug folder
245
+ _debug
pepbench-0.1.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Machine Learning and Data Analytics Lab (MaD Lab), Friedrich-Alexander-Universität Erlangen-Nürnberg (FAU)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,179 @@
1
+ Metadata-Version: 2.4
2
+ Name: pepbench
3
+ Version: 0.1.1
4
+ Summary: A python package to benchmark different pre-ejection period (PEP) extraction algorithms.
5
+ Author-email: Robert Richer <robert.richer@fau.de>
6
+ License-Expression: MIT
7
+ License-File: LICENSE
8
+ Requires-Python: <4.0,>=3.10
9
+ Requires-Dist: biopsykit>=0.12.3
10
+ Requires-Dist: jinja2<4,>=3.1.4
11
+ Requires-Dist: pooch>=1.8.2
12
+ Requires-Dist: pytest-cov>=6.0.0
13
+ Requires-Dist: tpcp>=2
14
+ Description-Content-Type: text/markdown
15
+
16
+ # PEPbench - The python package for automated pre-ejection period (PEP) extraction algorithms.
17
+
18
+ _pepbench_ presents a framework for the automated extraction of the pre-ejection period (PEP) from
19
+ electrocardiogram (ECG) and impedance cardiography (ICG) signals. The package includes a variety of
20
+ algorithms for PEP extraction, as well as tools for the evaluation of these algorithms.
21
+
22
+
23
+ - 💻 3 Q-peak and 10 B-point Detection [Algorithms](https://pepbench.readthedocs.io/en/latest/modules/index.html) from the literature
24
+ - 📚 Extensive [documentation](https://pepbench.readthedocs.io/en/latest/)
25
+ - 📝 Build to be [easily extendable](https://pepbench.readthedocs.io/en/latest/source/user_guide/create_own_algorithm.html)
26
+ - 📁 2 manually annotated [reference datasets](https://pepbench.readthedocs.io/en/latest/source/user_guide/datasets.html) for evaluation
27
+ - 📊 [Evaluation tools](https://pepbench.readthedocs.io/en/latest/source/user_guide/evaluation.html) for PEP extraction algorithms
28
+
29
+ **Documentation:** [pepbench.readthedocs.io](https://pepbench.readthedocs.io/en/latest/README.html)
30
+
31
+
32
+ ## Installation
33
+
34
+ First install a supported Python version (3.10 or higher) and then install the package using `pip`.
35
+
36
+ ```bash
37
+ pip install pepbench
38
+ ```
39
+
40
+ ### Installing from GitHub
41
+
42
+ If you want to install the latest version from GitHub, you can use the following command:
43
+
44
+ ```bash
45
+ pip install "git+https://github.com/empkins/pepbench.git"
46
+ ```
47
+
48
+ If you run into problems, clone the repository and install the package locally.
49
+
50
+ ```bash
51
+ git clone https://github.com/empkins/pepbench.git
52
+ cd pepbench
53
+ pip install .
54
+ ```
55
+
56
+ Note: We don't guarantee that the latest version on GitHub is stable.
57
+
58
+ ## Usage Recommendation
59
+
60
+ `pepbench` is designed to be used in the following ways:
61
+
62
+ 1. **Usage as a full end-to-end pipeline**:
63
+ We provide configurable pipelines to extract the PEP per-heartbeat from ECG and ICG signals. The exact
64
+ configuration of the pipeline (i.e., which algorithm combinations are used) depend on the dataset and
65
+ can be adjusted to the specific use case. A systematic evaluation of different algorithm combinations
66
+ is subject to the paper "PEPbench – Open, Reproducible, and Systematic Benchmarking of Automated
67
+ Pre-Ejection Period Extraction Algorithms".
68
+
69
+ In this case, we recommend to cite the paper and the package as follows:
70
+
71
+ > PEP extraction was performed using the `pepbench` Python library pipeline (version {insert version you used})
72
+ > as described in the paper [[1]] with the Q-peak extraction proposed by Martinez et al. [[2]] and the B-point
73
+ > extraction algorithm proposed by Drost et al. [[3]].
74
+
75
+ ```
76
+ [1] <pepbench citation>
77
+ [2] Martinez, J. P., Almeida, R., Olmos, S., Rocha, A. P., & Laguna, P. (2004). A wavelet-based ECG delineator
78
+ evaluation on standard databases. IEEE Transactions on Biomedical Engineering, 51(4), 570-581.
79
+ https://doi.org/10.1109/TBME.2003.821031
80
+ [3] Drost, L., Finke, J. B., Port, J., & Schächinger, H. (2022). Comparison of TWA and PEP as indices of a2- and
81
+ ß-adrenergic activation. Psychopharmacology. https://doi.org/10.1007/s00213-022-06114-8
82
+ ```
83
+
84
+ 2. **Usage of individual algorithms**:
85
+ If you are only interested in a specific algorithm, you can use the individual algorithms provided in the package.
86
+ If you are using individual algorithms in this way, we recommend citing the original papers the algorithms were
87
+ proposed in and `pepbench` as a software library. You can find the best references for each algorithm in the documentation of the respective algorithm.
88
+
89
+
90
+ > B-points were extracted using the{name of algorithm} algorithm [[1]] as implemented in the `pepbench` Python
91
+ library [[2]] (version {insert version you used}).
92
+
93
+ ```
94
+ [1] <algorithm citation>
95
+ [2] <pepbench citation>
96
+ ```
97
+
98
+
99
+
100
+ ## Contributing
101
+
102
+ **We want to hear from you (and we want your algorithms)!**
103
+
104
+ 👍 We are always happy to receive feedback and contributions.
105
+ If you run into any issues or have any questions, please open an [issue on GitHub](https://github.com/empkins/pepbench/issues)
106
+ or start a [discussions](https://github.com/empkins/pepbench/discussions) thread.
107
+
108
+ 📚 If you are using *pepbench* in your research or project, we would love to hear about it and link your work here!
109
+
110
+ 💻 And most importantly, we want your algorithms!
111
+ 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.
112
+ We are happy to help you with the integration process.
113
+ Even if you are not confident in your Python skills, we can discuss ways to get your algorithm into _pepbench_.
114
+
115
+
116
+ ## License
117
+
118
+ _pepbench_ (and _biopsykit_, which contains the core algorithm implementations) are published under a
119
+ [MIT license](https://opensource.org/license/mit/). This is a permissive license, which allows you to use the code in
120
+ nearly any way you want, as long as you include the original license in you modified version.
121
+
122
+
123
+ ## For Developers
124
+
125
+ Install Python >=3.10 and [uv](https://docs.astral.sh/uv/getting-started/installation/).
126
+ Then run the commands below to install [poethepoet](https://poethepoet.natn.io), get the latest source,
127
+ and install the dependencies:
128
+
129
+ ```bash
130
+ git clone https://github.com/empkins/pepbench.git
131
+ uv tool install poethepoet
132
+ uv sync --all-extras --dev
133
+ ```
134
+
135
+ All dependencies are specified in the main `pyproject.toml` when running `uv sync`.
136
+
137
+ To run any of the tools required for the development workflow, use the provided
138
+ [poethepoet](https://github.com/nat-n/poethepoet) commands:
139
+
140
+ ```bash
141
+ uv run poe
142
+ ...
143
+ CONFIGURED TASKS
144
+ format Format all files with black.
145
+ lint Lint all files with ruff.
146
+ check Check all potential format and linting issues.
147
+ test Run Pytest with coverage.
148
+ docs Build the html docs using Sphinx.
149
+ conf_jupyter Register the pepbench environment as a Jupyter kernel for testing.
150
+ version Bump version in all relevant places.
151
+
152
+ ```
153
+
154
+ ### Format and Linting
155
+
156
+ To ensure consistent code structure this project uses black and ruff to automatically check (and fix) the code format.
157
+
158
+ ```
159
+ poe format # runs ruff format and ruff lint with the autofix flag
160
+ poe lint # runs ruff without autofix (will show issues that can not automatically be fixed)
161
+ ```
162
+
163
+ If you want to check if all code follows the code guidelines, run `poe ci_check`.
164
+ This can be useful in the CI context.
165
+
166
+
167
+ ### Tests
168
+
169
+ All tests are located in the `tests` folder and can be executed by using `poe test`.
170
+
171
+
172
+ ## Funding and Support
173
+
174
+ This work was developed within the *Empkins* collaborative research center (SFB 1483) funded by the Deutsche
175
+ Forschungsgemeinschaft (DFG, German Research Foundation) - Project-ID 442419336, EmpkinS.
176
+
177
+ <p align="center">
178
+ <img src="./docs/_static/logo/logo_empkins.svg" height="400">
179
+ </p>
@@ -0,0 +1,164 @@
1
+ # PEPbench - The python package for automated pre-ejection period (PEP) extraction algorithms.
2
+
3
+ _pepbench_ presents a framework for the automated extraction of the pre-ejection period (PEP) from
4
+ electrocardiogram (ECG) and impedance cardiography (ICG) signals. The package includes a variety of
5
+ algorithms for PEP extraction, as well as tools for the evaluation of these algorithms.
6
+
7
+
8
+ - 💻 3 Q-peak and 10 B-point Detection [Algorithms](https://pepbench.readthedocs.io/en/latest/modules/index.html) from the literature
9
+ - 📚 Extensive [documentation](https://pepbench.readthedocs.io/en/latest/)
10
+ - 📝 Build to be [easily extendable](https://pepbench.readthedocs.io/en/latest/source/user_guide/create_own_algorithm.html)
11
+ - 📁 2 manually annotated [reference datasets](https://pepbench.readthedocs.io/en/latest/source/user_guide/datasets.html) for evaluation
12
+ - 📊 [Evaluation tools](https://pepbench.readthedocs.io/en/latest/source/user_guide/evaluation.html) for PEP extraction algorithms
13
+
14
+ **Documentation:** [pepbench.readthedocs.io](https://pepbench.readthedocs.io/en/latest/README.html)
15
+
16
+
17
+ ## Installation
18
+
19
+ First install a supported Python version (3.10 or higher) and then install the package using `pip`.
20
+
21
+ ```bash
22
+ pip install pepbench
23
+ ```
24
+
25
+ ### Installing from GitHub
26
+
27
+ If you want to install the latest version from GitHub, you can use the following command:
28
+
29
+ ```bash
30
+ pip install "git+https://github.com/empkins/pepbench.git"
31
+ ```
32
+
33
+ If you run into problems, clone the repository and install the package locally.
34
+
35
+ ```bash
36
+ git clone https://github.com/empkins/pepbench.git
37
+ cd pepbench
38
+ pip install .
39
+ ```
40
+
41
+ Note: We don't guarantee that the latest version on GitHub is stable.
42
+
43
+ ## Usage Recommendation
44
+
45
+ `pepbench` is designed to be used in the following ways:
46
+
47
+ 1. **Usage as a full end-to-end pipeline**:
48
+ We provide configurable pipelines to extract the PEP per-heartbeat from ECG and ICG signals. The exact
49
+ configuration of the pipeline (i.e., which algorithm combinations are used) depend on the dataset and
50
+ can be adjusted to the specific use case. A systematic evaluation of different algorithm combinations
51
+ is subject to the paper "PEPbench – Open, Reproducible, and Systematic Benchmarking of Automated
52
+ Pre-Ejection Period Extraction Algorithms".
53
+
54
+ In this case, we recommend to cite the paper and the package as follows:
55
+
56
+ > PEP extraction was performed using the `pepbench` Python library pipeline (version {insert version you used})
57
+ > as described in the paper [[1]] with the Q-peak extraction proposed by Martinez et al. [[2]] and the B-point
58
+ > extraction algorithm proposed by Drost et al. [[3]].
59
+
60
+ ```
61
+ [1] <pepbench citation>
62
+ [2] Martinez, J. P., Almeida, R., Olmos, S., Rocha, A. P., & Laguna, P. (2004). A wavelet-based ECG delineator
63
+ evaluation on standard databases. IEEE Transactions on Biomedical Engineering, 51(4), 570-581.
64
+ https://doi.org/10.1109/TBME.2003.821031
65
+ [3] Drost, L., Finke, J. B., Port, J., & Schächinger, H. (2022). Comparison of TWA and PEP as indices of a2- and
66
+ ß-adrenergic activation. Psychopharmacology. https://doi.org/10.1007/s00213-022-06114-8
67
+ ```
68
+
69
+ 2. **Usage of individual algorithms**:
70
+ If you are only interested in a specific algorithm, you can use the individual algorithms provided in the package.
71
+ If you are using individual algorithms in this way, we recommend citing the original papers the algorithms were
72
+ proposed in and `pepbench` as a software library. You can find the best references for each algorithm in the documentation of the respective algorithm.
73
+
74
+
75
+ > B-points were extracted using the{name of algorithm} algorithm [[1]] as implemented in the `pepbench` Python
76
+ library [[2]] (version {insert version you used}).
77
+
78
+ ```
79
+ [1] <algorithm citation>
80
+ [2] <pepbench citation>
81
+ ```
82
+
83
+
84
+
85
+ ## Contributing
86
+
87
+ **We want to hear from you (and we want your algorithms)!**
88
+
89
+ 👍 We are always happy to receive feedback and contributions.
90
+ If you run into any issues or have any questions, please open an [issue on GitHub](https://github.com/empkins/pepbench/issues)
91
+ or start a [discussions](https://github.com/empkins/pepbench/discussions) thread.
92
+
93
+ 📚 If you are using *pepbench* in your research or project, we would love to hear about it and link your work here!
94
+
95
+ 💻 And most importantly, we want your algorithms!
96
+ 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.
97
+ We are happy to help you with the integration process.
98
+ Even if you are not confident in your Python skills, we can discuss ways to get your algorithm into _pepbench_.
99
+
100
+
101
+ ## License
102
+
103
+ _pepbench_ (and _biopsykit_, which contains the core algorithm implementations) are published under a
104
+ [MIT license](https://opensource.org/license/mit/). This is a permissive license, which allows you to use the code in
105
+ nearly any way you want, as long as you include the original license in you modified version.
106
+
107
+
108
+ ## For Developers
109
+
110
+ Install Python >=3.10 and [uv](https://docs.astral.sh/uv/getting-started/installation/).
111
+ Then run the commands below to install [poethepoet](https://poethepoet.natn.io), get the latest source,
112
+ and install the dependencies:
113
+
114
+ ```bash
115
+ git clone https://github.com/empkins/pepbench.git
116
+ uv tool install poethepoet
117
+ uv sync --all-extras --dev
118
+ ```
119
+
120
+ All dependencies are specified in the main `pyproject.toml` when running `uv sync`.
121
+
122
+ To run any of the tools required for the development workflow, use the provided
123
+ [poethepoet](https://github.com/nat-n/poethepoet) commands:
124
+
125
+ ```bash
126
+ uv run poe
127
+ ...
128
+ CONFIGURED TASKS
129
+ format Format all files with black.
130
+ lint Lint all files with ruff.
131
+ check Check all potential format and linting issues.
132
+ test Run Pytest with coverage.
133
+ docs Build the html docs using Sphinx.
134
+ conf_jupyter Register the pepbench environment as a Jupyter kernel for testing.
135
+ version Bump version in all relevant places.
136
+
137
+ ```
138
+
139
+ ### Format and Linting
140
+
141
+ To ensure consistent code structure this project uses black and ruff to automatically check (and fix) the code format.
142
+
143
+ ```
144
+ poe format # runs ruff format and ruff lint with the autofix flag
145
+ poe lint # runs ruff without autofix (will show issues that can not automatically be fixed)
146
+ ```
147
+
148
+ If you want to check if all code follows the code guidelines, run `poe ci_check`.
149
+ This can be useful in the CI context.
150
+
151
+
152
+ ### Tests
153
+
154
+ All tests are located in the `tests` folder and can be executed by using `poe test`.
155
+
156
+
157
+ ## Funding and Support
158
+
159
+ This work was developed within the *Empkins* collaborative research center (SFB 1483) funded by the Deutsche
160
+ Forschungsgemeinschaft (DFG, German Research Foundation) - Project-ID 442419336, EmpkinS.
161
+
162
+ <p align="center">
163
+ <img src="./docs/_static/logo/logo_empkins.svg" height="400">
164
+ </p>
@@ -0,0 +1,97 @@
1
+ [project]
2
+ name = "pepbench"
3
+ version = "0.1.1"
4
+ description = "A python package to benchmark different pre-ejection period (PEP) extraction algorithms."
5
+ authors = [{ name = "Robert Richer", email = "robert.richer@fau.de" }]
6
+ requires-python = ">=3.10,<4.0"
7
+ readme = "README.md"
8
+ license = "MIT"
9
+ dependencies = [
10
+ "biopsykit>=0.12.3",
11
+ "tpcp>=2",
12
+ "jinja2>=3.1.4,<4",
13
+ "pytest-cov>=6.0.0",
14
+ "pooch>=1.8.2",
15
+ ]
16
+
17
+ [dependency-groups]
18
+ dev = [
19
+ "black>=24.8.0,<25",
20
+ "ruff>=0.6.3,<0.7",
21
+ "ipython>=8.26.0,<9",
22
+ "ipywidgets>=8.1.3,<9",
23
+ "ipympl>=0.9.4,<0.10",
24
+ "ipykernel>=6.29.5,<7",
25
+ "pytest>=8.3.4,<9",
26
+ "numpydoc>=1.8.0,<2",
27
+ "poethepoet>=0.33.0",
28
+ "toml>=0.10.2",
29
+ "sphinx-gallery>=0.19.0",
30
+ "recommonmark>=0.7.1",
31
+ "memory-profiler>=0.61.0",
32
+ "pydata-sphinx-theme>=0.16.1",
33
+ "sphinx-copybutton>=0.5.2",
34
+ "nbsphinx>=0.9.7",
35
+ ]
36
+
37
+ [tool.uv.sources]
38
+ biopsykit = { git = "https://github.com/mad-lab-fau/BioPsyKit.git", branch = "main" }
39
+
40
+ [build-system]
41
+ requires = ["hatchling"]
42
+ build-backend = "hatchling.build"
43
+
44
+ [tool.hatch.build.targets.sdist]
45
+ include = ["src/pepbench"]
46
+
47
+ [tool.hatch.build.targets.wheel]
48
+ include = ["src/pepbench"]
49
+
50
+ [tool.hatch.build.targets.wheel.sources]
51
+ "src/pepbench" = "pepbench"
52
+
53
+ [tool.black]
54
+ line-length = 120
55
+ target-version = ['py310']
56
+ exclude = '''
57
+ (
58
+ /(
59
+ \.eggs # exclude a few common directories in the
60
+ | \.git # root of the project
61
+ | \.hg
62
+ | \.mypy_cache
63
+ | \.tox
64
+ | \.venv
65
+ | _build
66
+ | docs
67
+ | build
68
+ | dist
69
+ | \.virtual_documents
70
+ )/
71
+ )
72
+ '''
73
+
74
+ [tool.isort]
75
+ profile = "black"
76
+ multi_line_output = 3
77
+ line_length = 120
78
+ skip_gitignore = true
79
+
80
+ [tool.poe.tasks]
81
+ _format = "ruff format ."
82
+ _auto_fix = "ruff check . --fix-only --show-fixes --exit-zero"
83
+ _auto_fix_unsafe = "ruff check . --fix-only --show-fixes --exit-zero --unsafe-fixes"
84
+ format = ["_auto_fix", "_format"]
85
+ format_unsafe = ["_auto_fix_unsafe", "_format"]
86
+ lint = { cmd = "ruff check src --fix", help = "Lint all files with ruff." }
87
+ _lint_ci = "ruff check src --output-format=github"
88
+ _check_format = "ruff format . --check"
89
+ ci_check = { sequence = ["_check_format", "_lint_ci"], help = "Check all potential format and linting issues." }
90
+ test = { cmd = "pytest --cov=pepbench --cov-report=term-missing --cov-report=xml", help = "Run Pytest with coverage." }
91
+ docs = { "script" = "_tasks:task_docs()", help = "Build the html docs using Sphinx." }
92
+ docs_clean = { "script" = "_tasks:task_docs(clean=True)", help = "Remove all old build files and build a clean version of the docs." }
93
+ docs_preview = { cmd = "python -m http.server --directory docs/_build/html", help = "Preview the built html docs." }
94
+ version = { cmd = "uvx bump-my-version" }
95
+ conf_jupyter = { cmd = "python -m ipykernel install --user --name pepbench --display-name pepbench", help = "Add a new jupyter kernel for the project."}
96
+ remove_jupyter = { cmd = "jupyter kernelspec uninstall pepbench", help = "Remove the project specific jupyter kernel."}
97
+ update_example_data = { script="_tasks:task_update_example_data", help = "Update the example data registry."}