Skip to content

Commit b48b3b3

Browse files
committed
added smoke tests for transformations
1 parent 384ffc1 commit b48b3b3

8 files changed

Lines changed: 705 additions & 168 deletions

File tree

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@ To run a single test function by name:
4949

5050
python -m pytest tests/test_errors.py -k wavread
5151

52+
Main smoke test files:
53+
54+
tests/test_models_smoke.py
55+
tests/test_transformations_smoke.py
56+
57+
Run only smoke tests:
58+
59+
python -m pytest -k smoke
60+
5261

5362
Jupyter Notebooks
5463
-------

sms_tools.egg-info/PKG-INFO

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,34 @@ To build and install the package locally you can use the python packaging tools:
5555
python -m build
5656

5757

58+
Running tests
59+
-------------
60+
61+
To run the unit test suite locally:
62+
63+
python3 -m venv .venv
64+
source .venv/bin/activate
65+
python -m pip install -e ".[test]"
66+
python -m pytest
67+
68+
To run a single test file:
69+
70+
python -m pytest tests/test_errors.py
71+
72+
To run a single test function by name:
73+
74+
python -m pytest tests/test_errors.py -k wavread
75+
76+
Main smoke test files:
77+
78+
tests/test_models_smoke.py
79+
tests/test_transformations_smoke.py
80+
81+
Run only smoke tests:
82+
83+
python -m pytest -k smoke
84+
85+
5886
Jupyter Notebooks
5987
-------
6088
We provide a separate repository of examples and teaching materials in the form of Jupyter notebooks.

sms_tools.egg-info/SOURCES.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,6 @@ smstools/transformations/stftTransformations.py
3131
smstools/transformations/stochasticTransformations.py
3232
tests/conftest.py
3333
tests/test_api_contracts.py
34-
tests/test_dft_stft_smoke.py
35-
tests/test_errors.py
34+
tests/test_errors.py
35+
tests/test_models_smoke.py
36+
tests/test_transformations_smoke.py

smstools/models/utilFunctions_C/cutilFunctions.c

Lines changed: 122 additions & 122 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/conftest.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,15 @@ def genSpecSines(iploc, ipmag, ipphase, N):
2222

2323
return np.zeros(N, dtype=complex)
2424

25+
def twm(pfreq, pmag, f0cf):
26+
import numpy as np
27+
28+
if f0cf.size == 0:
29+
return 0.0, np.inf
30+
return float(f0cf[np.argmax(f0cf > 0)] if np.any(f0cf > 0) else f0cf[0]), 0.0
31+
2532
stub_module.genSpecSines = genSpecSines
33+
stub_module.twm = twm
2634
package_module.utilFunctions_C = stub_module
2735
sys.modules[module_name] = stub_module
2836

tests/test_dft_stft_smoke.py

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)