Skip to content

Commit 39cdf24

Browse files
committed
Separating command line argument parsing from code
1 parent 3ef4b0b commit 39cdf24

7 files changed

Lines changed: 361 additions & 249 deletions

File tree

.coverage

52 KB
Binary file not shown.

.github/workflows/pytest.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
matrix:
1010
python-version: ['3.10', 3.11, 3.12, 3.13, 3.14]
11-
11+
1212
steps:
1313
- name: Checkout repository
1414
uses: actions/checkout@v4
@@ -36,16 +36,15 @@ jobs:
3636
wget https://cardiac.nottingham.ac.uk/syncropatch_export/test_data.tar.xz -P tests/
3737
tar xvf tests/test_data.tar.xz -C tests/
3838
39-
- name: Test with pytest
40-
run: |
41-
python -m pip install -e .
42-
python -m pytest --cov --cov-config=.coveragerc
43-
4439
- name: Install TeX dependencies
4540
timeout-minutes: 15
4641
run: |
4742
sudo apt-get install dvipng texlive-latex-extra texlive-fonts-recommended cm-super -y
4843
44+
- name: Run unit tests and check coverage
45+
run: |
46+
coverage run python -m unittest
47+
4948
- name: Test running QC
5049
timeout-minutes: 15
5150
run: |

example_export_config.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44

55
# Copy this config file to the top-level data directory and modify fields.
66

7-
# Data output directory
8-
savedir = './data'
9-
107
# Save name for this set of data
118
saveID = 'EXPERIMENT_NAME'
129

pcpostprocess/_version.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# file generated by setuptools-scm
2+
# don't change, don't track in version control
3+
4+
__all__ = [
5+
"__version__",
6+
"__version_tuple__",
7+
"version",
8+
"version_tuple",
9+
"__commit_id__",
10+
"commit_id",
11+
]
12+
13+
TYPE_CHECKING = False
14+
if TYPE_CHECKING:
15+
from typing import Tuple
16+
from typing import Union
17+
18+
VERSION_TUPLE = Tuple[Union[int, str], ...]
19+
COMMIT_ID = Union[str, None]
20+
else:
21+
VERSION_TUPLE = object
22+
COMMIT_ID = object
23+
24+
version: str
25+
__version__: str
26+
__version_tuple__: VERSION_TUPLE
27+
version_tuple: VERSION_TUPLE
28+
commit_id: COMMIT_ID
29+
__commit_id__: COMMIT_ID
30+
31+
__version__ = version = '0.1.dev374+dirty'
32+
__version_tuple__ = version_tuple = (0, 1, 'dev374', 'dirty')
33+
34+
__commit_id__ = commit_id = 'g9ee4de552'

pcpostprocess/scripts/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def main():
1818
sys.argv.pop(1) # Subcommand's argparser shouldn't see this
1919

2020
if args.subcommand == "run_herg_qc":
21-
run_herg_qc.main()
21+
run_herg_qc.run_from_command_line()
2222

2323
elif args.subcommand == "summarise_herg_export":
2424
summarise_herg_export.main()

0 commit comments

Comments
 (0)