From 9b6b1d891bb596522e7122edfa7b9a747bbe37d8 Mon Sep 17 00:00:00 2001 From: Hagen Wierstorf Date: Wed, 19 Jun 2024 08:56:40 +0200 Subject: [PATCH] Require audmath>=1.4.1 to support numpy 2.0 (#175) * Require audmath>=1.4.1 to support numpy 2.0 * Require numpy<2.0.0 for docs * DOC: require soxr>=0.4.0b1 * Remove support for Python 3.8 --- .github/workflows/test.yml | 2 +- audinterface/core/process.py | 8 ++++---- docs/requirements.txt | 1 + pyproject.toml | 5 ++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3dc4021..691fdaa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: os: [ ubuntu-latest, windows-latest, macos-latest ] - python-version: [ '3.8', '3.9', '3.10', '3.11' ] + python-version: [ '3.9', '3.10', '3.11' ] steps: - uses: actions/checkout@v3 diff --git a/audinterface/core/process.py b/audinterface/core/process.py index 012af49..d10b5e0 100644 --- a/audinterface/core/process.py +++ b/audinterface/core/process.py @@ -111,7 +111,7 @@ class Process: Examples: >>> def mean(signal, sampling_rate): - ... return signal.mean() + ... return float(signal.mean()) >>> interface = Process(process_func=mean) >>> signal = np.array([1.0, 2.0, 3.0]) >>> interface(signal, sampling_rate=3) @@ -133,11 +133,11 @@ class Process: >>> interface.process_index(index, root=db.root) file start end wav/03a01Fa.wav 0 days 0 days 00:00:01.898250 -0.000311 - dtype: float32 + dtype: float64 >>> interface.process_index(index, root=db.root, preserve_index=True) file wav/03a01Fa.wav -0.000311 - dtype: float32 + dtype: float64 >>> # Apply interface with a sliding window >>> interface = Process( ... process_func=mean, @@ -148,7 +148,7 @@ class Process: file start end wav/03a01Fa.wav 0 days 00:00:00 0 days 00:00:01 -0.000329 0 days 00:00:00.500000 0 days 00:00:01.500000 -0.000285 - dtype: float32 + dtype: float64 """ # noqa: E501 diff --git a/docs/requirements.txt b/docs/requirements.txt index 7c26937..ce43b23 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -5,6 +5,7 @@ ipykernel jupyter-sphinx librosa pyarrow +soxr >=0.4.0b1 # for numpy 2, https://github.com/dofuuz/python-soxr/issues/28 sphinx sphinx-apipages >=0.1.2 sphinx-audeering-theme >=1.2.1 diff --git a/pyproject.toml b/pyproject.toml index 028e8fe..a19c3d3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,18 +24,17 @@ classifiers = [ 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', 'Topic :: Scientific/Engineering', ] -requires-python = '>=3.8' +requires-python = '>=3.9' dependencies = [ 'audeer >=1.18.0', 'audformat >=1.0.1,<2.0.0', 'audiofile >=1.3.0', - 'audmath >=1.3.0', + 'audmath >=1.4.1', 'audresample >=1.1.0,<2.0.0', ] # Get version dynamically from git