Skip to content

Commit

Permalink
Remove joblib dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-hld committed Nov 22, 2024
1 parent d45e164 commit 206b8ff
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 24 deletions.
2 changes: 1 addition & 1 deletion docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ It's easiest to start with something like `Anaconda <https://www.anaconda.com/di
You'll need Python >= 3.6 .

#. Create a conda environment:
* `conda create --name spaudio python=3.6 anaconda joblib portaudio`
* `conda create --name spaudio python=3.8 anaconda portaudio`
#. Activate this new environment:
* `conda activate spaudio`

Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
install_requires=[
'numpy',
'scipy',
'joblib',
'matplotlib !=3.1.*, !=3.2.*', # axis3d aspect broken
'soundfile',
'sounddevice',
Expand Down
12 changes: 1 addition & 11 deletions spaudiopy/parsa.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,21 @@
x_nm += np.sqrt(16/(4*np.pi)) * np.random.randn(16, 10000)
spa.plot.sh_rms_map(x_nm, title="Input SHD Signal")
**Memory cached functions**
.. autofunction:: spaudiopy.parsa.pseudo_intensity(ambi_b, win_len=33, f_bp=None, smoothing_order=5, jobs_count=1)
.. autofunction:: spaudiopy.parsa.render_bsdm(sdm_p, sdm_phi, sdm_theta, hrirs, jobs_count=None)
"""

from itertools import repeat
from warnings import warn
import logging

import numpy as np
from joblib import Memory
import multiprocessing

from scipy import signal
from . import utils, sph
from . import process as pcs


# Prepare Caching
cachedir = './.spa_cache_dir'
memory = Memory(cachedir)
# Prepare
shared_array = None
lock = multiprocessing.RLock()

Expand Down Expand Up @@ -405,7 +397,6 @@ def _intensity_sample(i, W, X, Y, Z, win):
np.trapz(win * W[i:i + buf] * Z[i:i + buf])])


@memory.cache
def pseudo_intensity(ambi_b, win_len=33, f_bp=None, smoothing_order=5,
jobs_count=1):
"""Direction of arrival (DOA) for each time sample from pseudo-intensity.
Expand Down Expand Up @@ -536,7 +527,6 @@ def _render_bsdm_sample(i, p, phi, theta, hrirs):
shared_array[i:i + len(h_r), 1] += p * h_r


@memory.cache
def render_bsdm(sdm_p, sdm_phi, sdm_theta, hrirs, jobs_count=1):
"""Binaural SDM Render.
Convolves each sample with corresponding hrir. No Post-EQ.
Expand Down
11 changes: 0 additions & 11 deletions spaudiopy/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,18 @@
import spaudiopy as spa
**Memory cached functions**
.. autofunction:: spaudiopy.process.resample_hrirs(hrir_l, hrir_r, fs_hrir, fs_target, jobs_count=None)
"""

import numpy as np
import resampy
import pickle
from scipy import signal
from joblib import Memory
import multiprocessing
import logging

from . import utils, sph, sig, grids


# Prepare Caching
cachedir = './.spa_cache_dir'
memory = Memory(cachedir)


@memory.cache
def resample_hrirs(hrir_l, hrir_r, fs_hrir, fs_target, jobs_count=None):
"""
Resample HRIRs to new SamplingRate(t), using multiprocessing.
Expand Down

0 comments on commit 206b8ff

Please sign in to comment.