Skip to content

Commit

Permalink
Update travis builds (CPJKU#479)
Browse files Browse the repository at this point in the history
update Python versions
  • Loading branch information
Sebastian Böck authored Dec 29, 2021
1 parent 7e56070 commit a947e6c
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 71 deletions.
15 changes: 6 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
language: python
matrix:
include:
- python: 2.7
dist: xenial
sudo: required
- python: 3.5
- python: 3.7
dist: xenial
sudo: required
- python: 3.6
dist: xenial
- python: 3.8
dist: focal
sudo: required
- python: 3.7
dist: xenial
- python: 3.9
dist: focal
sudo: required
before_install:
# get a working ffmpeg
Expand Down Expand Up @@ -46,7 +43,7 @@ install:
before_script:
- pep8 --ignore=E402 madmom tests bin
script:
- pytest --cov --doctest-modules --doctest-ignore-import-errors madmom tests
- pytest --cov --doctest-ignore-import-errors madmom tests
after_success:
- codecov
- coveralls
120 changes: 66 additions & 54 deletions setup.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -21,50 +21,60 @@
include_dirs = [np.get_include()]

extensions = [
Extension('madmom.audio.comb_filters', ['madmom/audio/comb_filters.pyx'],
include_dirs=include_dirs),
Extension('madmom.features.beats_crf', ['madmom/features/beats_crf.pyx'],
include_dirs=include_dirs),
Extension('madmom.ml.hmm', ['madmom/ml/hmm.pyx'],
include_dirs=include_dirs),
Extension('madmom.ml.nn.layers', ['madmom/ml/nn/layers.py'],
include_dirs=include_dirs),
Extension(
'madmom.audio.comb_filters',
['madmom/audio/comb_filters.pyx'],
include_dirs=include_dirs,
),
Extension(
'madmom.features.beats_crf',
['madmom/features/beats_crf.pyx'],
include_dirs=include_dirs,
),
Extension('madmom.ml.hmm', ['madmom/ml/hmm.pyx'], include_dirs=include_dirs),
Extension(
'madmom.ml.nn.layers', ['madmom/ml/nn/layers.py'], include_dirs=include_dirs
),
]

# define scripts to be installed by the PyPI package
scripts = glob.glob('bin/*')

# define the models to be included in the PyPI package
package_data = ['models/LICENSE',
'models/README.rst',
'models/beats/201[56]/*',
'models/chords/*/*',
'models/chroma/*/*',
'models/downbeats/*/*',
'models/key/2018/*',
'models/notes/*/*',
'models/onsets/*/*',
'models/patterns/*/*',
]
package_data = [
'models/LICENSE',
'models/README.rst',
'models/beats/201[56]/*',
'models/chords/*/*',
'models/chroma/*/*',
'models/downbeats/*/*',
'models/key/2018/*',
'models/notes/*/*',
'models/onsets/*/*',
'models/patterns/*/*',
]

# some PyPI metadata
classifiers = ['Development Status :: 3 - Alpha',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Environment :: Console',
'License :: OSI Approved :: BSD License',
'License :: Free for non-commercial use',
'Topic :: Multimedia :: Sound/Audio :: Analysis',
'Topic :: Scientific/Engineering :: Artificial Intelligence']
classifiers = [
'Development Status :: 3 - Beta',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Environment :: Console',
'License :: OSI Approved :: BSD License',
'License :: Free for non-commercial use',
'Topic :: Multimedia :: Sound/Audio :: Analysis',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
]

# requirements
requirements = ['numpy>=1.13.4',
'scipy>=0.16',
'cython>=0.25',
'mido>=1.2.6',
]
requirements = [
'numpy>=1.13.4',
'scipy>=0.16',
'cython>=0.25',
'mido>=1.2.6',
]

# docs to be included
try:
Expand All @@ -75,23 +85,25 @@
long_description += '\n' + open('CHANGES.rst').read()

# the actual setup routine
setup(name='madmom',
version=version,
description='Python audio signal processing library',
long_description=long_description,
author='Department of Computational Perception, Johannes Kepler '
'University, Linz, Austria and Austrian Research Institute for '
'Artificial Intelligence (OFAI), Vienna, Austria',
author_email='[email protected]',
url='https://github.com/CPJKU/madmom',
license='BSD, CC BY-NC-SA',
packages=find_packages(exclude=['tests', 'docs']),
ext_modules=cythonize(extensions),
package_data={'madmom': package_data},
exclude_package_data={'': ['tests', 'docs']},
scripts=scripts,
install_requires=requirements,
cmdclass={'build_ext': build_ext},
setup_requires=['pytest-runner'],
tests_require=['pytest'],
classifiers=classifiers)
setup(
name='madmom',
version=version,
description='Python audio signal processing library',
long_description=long_description,
author='Department of Computational Perception, Johannes Kepler '
'University, Linz, Austria and Austrian Research Institute for '
'Artificial Intelligence (OFAI), Vienna, Austria',
author_email='[email protected]',
url='https://github.com/CPJKU/madmom',
license='BSD, CC BY-NC-SA',
packages=find_packages(exclude=['tests', 'docs']),
ext_modules=cythonize(extensions),
package_data={'madmom': package_data},
exclude_package_data={'': ['tests', 'docs']},
scripts=scripts,
install_requires=requirements,
cmdclass={'build_ext': build_ext},
setup_requires=['pytest-runner'],
tests_require=['pytest'],
classifiers=classifiers,
)
4 changes: 2 additions & 2 deletions tests/test_audio_chroma.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def test_process(self):
tar = [0.62827758, 0.63810707, 0.64559874, 0.63725388, 0.60231739,
0.56549827, 0.49675867, 0.40509999, 0.38589308, 0.39961286,
0.43776578]
self.assertTrue(np.allclose(self.clp_50[100:111, 8], tar, atol=1e-5))
self.assertTrue(np.allclose(self.clp_50[100:111, 8], tar, atol=1e-4))
# test with fps=10
self.assertTrue(self.clp_10.bin_labels[0] == 'C')
self.assertTrue(self.clp_10.fps == 10)
Expand All @@ -76,7 +76,7 @@ def test_process(self):
self.assertTrue(self.clp_22050.shape == (141, 12))
tar = [[0.11270745, 0, 0, 0, 0.25741291, 0.58624929, 0.43997279,
0.0999583, 0.21696206, 0.54994475, 0.05542545, 0.14558826]]
self.assertTrue(np.allclose(self.clp_22050[140, :], tar))
self.assertTrue(np.allclose(self.clp_22050[140, :], tar, atol=1e-4))

def test_compare_with_matlab_toolbox(self):
# compare the results with the MATLAB chroma toolbox. There are
Expand Down
14 changes: 8 additions & 6 deletions tests/test_audio_spectrogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ def test_process(self):
[[0.00056659, 0.00274373, 0.00037994,
0.00031497, 0.0063823],
[0.00032294, 0.00285728, 0.00023723,
0.00010553, 0.0069074]]))
0.00010553, 0.0069074]], atol=1e-04))
self.assertTrue(np.allclose(self.sbs_50[:10, 0],
[0.00108844, 0.0020613, 0.00187792,
0.00173228, 0.00163516, 0.00149813,
Expand All @@ -729,17 +729,18 @@ def test_process(self):
[0.05326259, 0.10912816, 0.11616101,
0.11595627, 0.11979639, 0.12206492,
0.12836982, 0.12495992, 0.11759637,
0.10559082]))
0.10559082], atol=1e-04))
# test fps = 10
self.assertTrue(self.sbs_10.fps == 10)
self.assertTrue(self.sbs_10.shape == (29, 88))
sbs_10 = [[0.01951193, 0.01638364, 0.00384092, 0.00732366, 0.10310112],
[0.14484727, 0.032042, 0.00719009, 0.02043642, 0.06407038]]
self.assertTrue(np.allclose(self.sbs_10[10:12, 50:55], sbs_10))
self.assertTrue(np.allclose(self.sbs_10[10:12, 50:55], sbs_10,
atol=1e-04))
# test computing SemitoneBandpassSpectrogram from signal
self.assertTrue(self.sbs_10_from_signal.shape == (29, 88))
self.assertTrue(np.allclose(self.sbs_10_from_signal[10:12, 50:55],
sbs_10))
sbs_10, atol=1e-04))
# test 22050 Hz sampling rate. If we use only bands above 2637 Hz,
# no resampling is necessary and we can therefore compare with
# smaller tolerances.
Expand All @@ -748,12 +749,13 @@ def test_process(self):
0.05898506, 0.03190501, 0.04980498, 0.07482897],
[0.07191198, 0.07706247, 0.05581443, 0.03765683, 0.04524021,
0.03835757, 0.0295172, 0.04417975, 0.06682143]]
self.assertTrue(np.allclose(self.sbs_22050[108:110, :], tar))
self.assertTrue(np.allclose(self.sbs_22050[108:110, :], tar,
atol=1e-04))
# check end of signal
tar = [9.44913489e-06, 2.15330783e-05, 1.61559697e-05, 3.66821812e-06,
7.96367061e-06, 2.01982581e-05, 2.03380816e-06, 5.34317005e-06,
4.13617626e-06]
self.assertTrue(np.allclose(self.sbs_22050[140, :], tar))
self.assertTrue(np.allclose(self.sbs_22050[140, :], tar, atol=1e-04))

def test_compare_with_matlab_toolbox(self):
# compare the results with the MATLAB chroma toolbox. There are
Expand Down

0 comments on commit a947e6c

Please sign in to comment.