From 206b8fff038bf3f392da8ce9e68ea7d511decd59 Mon Sep 17 00:00:00 2001 From: Chris Hold Date: Fri, 22 Nov 2024 16:45:57 +0200 Subject: [PATCH] Remove joblib dependency --- docs/source/installation.rst | 2 +- setup.py | 1 - spaudiopy/parsa.py | 12 +----------- spaudiopy/process.py | 11 ----------- 4 files changed, 2 insertions(+), 24 deletions(-) diff --git a/docs/source/installation.rst b/docs/source/installation.rst index 4c2c56d..8d7c8c2 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -11,7 +11,7 @@ It's easiest to start with something like `Anaconda = 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` diff --git a/setup.py b/setup.py index 56ebd84..33ca599 100644 --- a/setup.py +++ b/setup.py @@ -33,7 +33,6 @@ install_requires=[ 'numpy', 'scipy', - 'joblib', 'matplotlib !=3.1.*, !=3.2.*', # axis3d aspect broken 'soundfile', 'sounddevice', diff --git a/spaudiopy/parsa.py b/spaudiopy/parsa.py index 2894c86..a165f99 100644 --- a/spaudiopy/parsa.py +++ b/spaudiopy/parsa.py @@ -19,11 +19,6 @@ 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 @@ -31,7 +26,6 @@ import logging import numpy as np -from joblib import Memory import multiprocessing from scipy import signal @@ -39,9 +33,7 @@ from . import process as pcs -# Prepare Caching -cachedir = './.spa_cache_dir' -memory = Memory(cachedir) +# Prepare shared_array = None lock = multiprocessing.RLock() @@ -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. @@ -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. diff --git a/spaudiopy/process.py b/spaudiopy/process.py index 31587c4..75301ed 100644 --- a/spaudiopy/process.py +++ b/spaudiopy/process.py @@ -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.