Skip to content

Commit

Permalink
updates for 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
bmcfee committed Mar 5, 2024
1 parent 1785107 commit feb06b6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion resampy/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,16 @@
'''

import numpy as np
import importlib_resources
import sys

try:
# Try to import from the standard library first (Python >= 3.9)
from importlib import resources as importlib_resources
except ImportError:
# Fall back to the backport
import importlib_resources


FILTER_FUNCTIONS = ['sinc_window']
FILTER_CACHE = dict()

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ python_requires >= 3.6
install_requires =
numpy>=1.17
numba>=0.53
importlib_resources; python_verssion < "3.9"
importlib_resources; python_version < "3.9"

[options.package_data]
resampy = data/*
Expand Down
2 changes: 1 addition & 1 deletion tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def test_good_window():
sr_orig = 100
sr_new = 200
x = np.random.randn(500)
y = resampy.resample(x, sr_orig, sr_new, filter='sinc_window', window=scipy.signal.blackman)
y = resampy.resample(x, sr_orig, sr_new, filter='sinc_window', window=scipy.signal.windows.blackman)

assert len(y) == 2 * len(x)

Expand Down

0 comments on commit feb06b6

Please sign in to comment.