Skip to content

Commit

Permalink
Enable parallelism
Browse files Browse the repository at this point in the history
  • Loading branch information
avalentino committed Jun 18, 2022
1 parent ee82e25 commit 4aac60f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-minimal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
shell: bash -l {0}
run: |
mamba install typing_extensions!=4.2 pytest
mamba install pip numpy==1.17 scipy==1.0 numba==0.41
mamba install pip numpy==1.17 scipy==1.0 numba==0.47
- name: Install
shell: bash -l {0}
Expand Down
9 changes: 8 additions & 1 deletion resampy/interpn.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
#!/usr/bin/env python
'''Numba implementation of resampler'''

import os
import numba


@numba.jit(nopython=True, nogil=True)
if os.environ.get('RESAMPY_PARALLEL', '').lower() in {'0', 'off', 'false', 'no'}:
_ENABLE_JIT_PARALLEL = False
else:
_ENABLE_JIT_PARALLEL = True


@numba.jit(nopython=True, nogil=True, parallel=_ENABLE_JIT_PARALLEL)
def resample_f(x, y, t_out, interp_win, interp_delta, num_table, scale=1.0):

index_step = int(scale * num_table)
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ install_package_data = True
python_requires >= 3.6
install_requires =
numpy>=1.17
numba>=0.41
numba>=0.47

[options.package_data]
resampy = data/*
Expand Down

0 comments on commit 4aac60f

Please sign in to comment.