Skip to content

Commit 384ffc1

Browse files
committed
added the initial test code
1 parent cbda490 commit 384ffc1

13 files changed

Lines changed: 13210 additions & 0 deletions

File tree

.github/workflows/tests.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Run unit tests
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [master]
7+
pull_request:
8+
branches: [master]
9+
10+
jobs:
11+
test:
12+
name: Pytest on ${{ matrix.os }} (Python ${{ matrix.python-version }})
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
os: [ubuntu-latest, macos-latest, windows-latest]
18+
python-version: ["3.9", "3.10", "3.11", "3.12"]
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Set up Python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
cache: pip
28+
29+
- name: Install package and test dependencies
30+
run: python -m pip install -e ".[test]"
31+
32+
- name: Run test suite
33+
run: python -m pytest

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,25 @@ To build and install the package locally you can use the python packaging tools:
3131
python -m build
3232

3333

34+
Running tests
35+
-------------
36+
37+
To run the unit test suite locally:
38+
39+
python3 -m venv .venv
40+
source .venv/bin/activate
41+
python -m pip install -e ".[test]"
42+
python -m pytest
43+
44+
To run a single test file:
45+
46+
python -m pytest tests/test_errors.py
47+
48+
To run a single test function by name:
49+
50+
python -m pytest tests/test_errors.py -k wavread
51+
52+
3453
Jupyter Notebooks
3554
-------
3655
We provide a separate repository of examples and teaching materials in the form of Jupyter notebooks.

pyproject.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ classifiers = [
2424
Homepage = "https://github.com/mtg/sms-tools"
2525
Issues = "https://github.com/mtg/sms-tools/issues"
2626

27+
[project.optional-dependencies]
28+
test = [
29+
"pytest>=8.0",
30+
"pytest-cov>=5.0"
31+
]
32+
2733
[tool.setuptools.packages]
2834
find = {}
2935

@@ -35,3 +41,8 @@ build-backend = "setuptools.build_meta"
3541
[tool.cibuildwheel]
3642
# Skip unneeded wheels: PyPy, python 3.6-3.8, musl, linux 32 bit, PPC, s390, windows 32bit
3743
skip = ["pp*", "cp36*", "cp37*", "cp38", "*i686*", "*musllinux*", "*ppc64le*", "*s390x*", "*win32"]
44+
45+
[tool.pytest.ini_options]
46+
testpaths = ["tests"]
47+
python_files = ["test_*.py"]
48+
addopts = "-ra"

sms_tools.egg-info/PKG-INFO

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
Metadata-Version: 2.4
2+
Name: sms-tools
3+
Version: 1.0.1
4+
Summary: Sound analysis/synthesis tools for music applications
5+
Author-email: "Music Technology Group, Universitat Pompeu Fabra" <mtg-info@upf.edu>
6+
Project-URL: Homepage, https://github.com/mtg/sms-tools
7+
Project-URL: Issues, https://github.com/mtg/sms-tools/issues
8+
Classifier: Development Status :: 5 - Production/Stable
9+
Classifier: Intended Audience :: Education
10+
Classifier: Intended Audience :: Science/Research
11+
Classifier: Topic :: Multimedia :: Sound/Audio :: Analysis
12+
Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
13+
Requires-Python: >=3.9
14+
Description-Content-Type: text/markdown
15+
License-File: LICENSE
16+
License-File: AUTHORS
17+
Requires-Dist: matplotlib
18+
Requires-Dist: numpy<2.0.0
19+
Requires-Dist: scipy
20+
Provides-Extra: test
21+
Requires-Dist: pytest>=8.0; extra == "test"
22+
Requires-Dist: pytest-cov>=5.0; extra == "test"
23+
Dynamic: license-file
24+
25+
sms-tools
26+
=========
27+
28+
Sound analysis/synthesis tools for music applications written in python.
29+
30+
The package includes the following sound analysis/synthesis models:
31+
32+
* dftModel.py: models based on the Discrete Fourier Transform
33+
* stft.py: models based on the Short-Time Fourier Transform
34+
* sineModel.py: models based on a Sinusoidal Model
35+
* harmonicModel.py: models based on a Harmonic Model
36+
* stochasticModel.py: models based on a Stochastic Model
37+
* sprModel.py: models based on a Sinusoidal plus Residual Model
38+
* spsModel.py: models based on a Sinusoidal plus Stochastic Model
39+
* hprModel.py: models based on a Harmonic plus Residual Model
40+
* hpsModel.py: models based on a Harmonic plus Stochastic Model
41+
42+
43+
Installation
44+
------------
45+
46+
Install using pip:
47+
48+
pip install sms-tools
49+
50+
Binary packages are available for Linux, macOS (Intel & Apple Silicon) and Windows (64 bit) on all recent python versions.
51+
52+
To build and install the package locally you can use the python packaging tools:
53+
54+
pip install build
55+
python -m build
56+
57+
58+
Jupyter Notebooks
59+
-------
60+
We provide a separate repository of examples and teaching materials in the form of Jupyter notebooks.
61+
You can find them at https://github.com/MTG/sms-tools-materials
62+
63+
License
64+
-------
65+
66+
sms-tools is made available under the terms of the Affero GPL license (http://www.gnu.org/licenses/agpl-3.0.en.html).

sms_tools.egg-info/SOURCES.txt

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
AUTHORS
2+
LICENSE
3+
MANIFEST.in
4+
README.md
5+
pyproject.toml
6+
setup.py
7+
sms_tools.egg-info/PKG-INFO
8+
sms_tools.egg-info/SOURCES.txt
9+
sms_tools.egg-info/dependency_links.txt
10+
sms_tools.egg-info/requires.txt
11+
sms_tools.egg-info/top_level.txt
12+
smstools/models/dftModel.py
13+
smstools/models/harmonicModel.py
14+
smstools/models/hprModel.py
15+
smstools/models/hpsModel.py
16+
smstools/models/sineModel.py
17+
smstools/models/sprModel.py
18+
smstools/models/spsModel.py
19+
smstools/models/stft.py
20+
smstools/models/stochasticModel.py
21+
smstools/models/utilFunctions.py
22+
smstools/models/utilFunctions_C/cutilFunctions.c
23+
smstools/models/utilFunctions_C/cutilFunctions.pxd
24+
smstools/models/utilFunctions_C/cutilFunctions.pyx
25+
smstools/models/utilFunctions_C/utilFunctions.c
26+
smstools/models/utilFunctions_C/utilFunctions.h
27+
smstools/transformations/harmonicTransformations.py
28+
smstools/transformations/hpsTransformations.py
29+
smstools/transformations/sineTransformations.py
30+
smstools/transformations/stftTransformations.py
31+
smstools/transformations/stochasticTransformations.py
32+
tests/conftest.py
33+
tests/test_api_contracts.py
34+
tests/test_dft_stft_smoke.py
35+
tests/test_errors.py
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

sms_tools.egg-info/requires.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
matplotlib
2+
numpy<2.0.0
3+
scipy
4+
5+
[test]
6+
pytest>=8.0
7+
pytest-cov>=5.0

sms_tools.egg-info/top_level.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
smstools
2+
tests

0 commit comments

Comments
 (0)