diff --git a/CHANGELOG.md b/CHANGELOG.md index e4b16877..09d6c06b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ Changelog ========= +# 2.3.1 +* Fixed bug in :py:mod:`pylops.utils.backend` (see [Issue #606](https://github.com/PyLops/pylops/issues/606)) + # 2.3.0 * Added `pylops.JaxOperator`, `pylops.signalprocessing.DWTND`, and `pylops.signalprocessing.DTCWT` operators. @@ -20,9 +23,9 @@ Changelog * Removed `cusignal` as optional dependency and `cupy`'s equivalent methods (since the library is now unmantained and merged into `cupy`). * Fixed ImportError of optional dependencies when installed but not correctly functioning (see [Issue #548](https://github.com/PyLops/pylops/issues/548)) -* Fixed bug in :py:func:`pylops.utils.deps.to_cupy_conditional` (see [Issue #579](https://github.com/PyLops/pylops/issues/579)) -* Fixed bug in the definition of `nttot` in :py:class:`pylops.waveeqprocessing.BlendingContinuous` -* Fixed bug in :py:func:`pylops.utils.signalprocessing.dip_estimate` (see [Issue #572](https://github.com/PyLops/pylops/issues/572)) +* Fixed bug in `pylops.utils.deps.to_cupy_conditional` (see [Issue #579](https://github.com/PyLops/pylops/issues/579)) +* Fixed bug in the definition of `nttot` in `pylops.waveeqprocessing.BlendingContinuous` +* Fixed bug in `pylops.utils.signalprocessing.dip_estimate` (see [Issue #572](https://github.com/PyLops/pylops/issues/572)) # 2.2.0 diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst index 86c67cdb..b5854475 100644 --- a/docs/source/changelog.rst +++ b/docs/source/changelog.rst @@ -3,6 +3,15 @@ Changelog ========= + +Version 2.3.1 +------------- + +*Released on: 17/08/2024* + +* Fixed bug in :py:mod:`pylops.utils.backend` (see https://github.com/PyLops/pylops/issues/606) + + Version 2.3.0 ------------- diff --git a/pylops/utils/backend.py b/pylops/utils/backend.py index 4b6b506f..50da7faa 100644 --- a/pylops/utils/backend.py +++ b/pylops/utils/backend.py @@ -128,7 +128,7 @@ def get_array_module(x: npt.ArrayLike) -> ModuleType: """ if deps.cupy_enabled or deps.jax_enabled: - if isinstance(x, jnp.ndarray): + if deps.jax_enabled and isinstance(x, jnp.ndarray): return jnp elif deps.cupy_enabled: return cp.get_array_module(x) @@ -153,7 +153,7 @@ def get_convolve(x: npt.ArrayLike) -> Callable: """ if deps.cupy_enabled or deps.jax_enabled: - if isinstance(x, jnp.ndarray): + if deps.jax_enabled and isinstance(x, jnp.ndarray): return j_convolve elif deps.cupy_enabled and cp.get_array_module(x) == cp: return cp_convolve @@ -178,7 +178,7 @@ def get_fftconvolve(x: npt.ArrayLike) -> Callable: """ if deps.cupy_enabled or deps.jax_enabled: - if isinstance(x, jnp.ndarray): + if deps.jax_enabled and isinstance(x, jnp.ndarray): return j_fftconvolve elif deps.cupy_enabled and cp.get_array_module(x) == cp: return cp_fftconvolve @@ -203,7 +203,7 @@ def get_oaconvolve(x: npt.ArrayLike) -> Callable: """ if deps.cupy_enabled or deps.jax_enabled: - if isinstance(x, jnp.ndarray): + if deps.jax_enabled and isinstance(x, jnp.ndarray): raise NotImplementedError( "oaconvolve not implemented in " "jax. Consider using a different" @@ -232,7 +232,7 @@ def get_correlate(x: npt.ArrayLike) -> Callable: """ if deps.cupy_enabled or deps.jax_enabled: - if isinstance(x, jnp.ndarray): + if deps.jax_enabled and isinstance(x, jnp.ndarray): return jax.scipy.signal.correlate elif deps.cupy_enabled and cp.get_array_module(x) == cp: return cp_correlate @@ -303,7 +303,7 @@ def get_block_diag(x: npt.ArrayLike) -> Callable: """ if deps.cupy_enabled or deps.jax_enabled: - if isinstance(x, jnp.ndarray): + if deps.jax_enabled and isinstance(x, jnp.ndarray): return jnp_block_diag elif deps.cupy_enabled and cp.get_array_module(x) == cp: return cp_block_diag @@ -328,7 +328,7 @@ def get_toeplitz(x: npt.ArrayLike) -> Callable: """ if deps.cupy_enabled or deps.jax_enabled: - if isinstance(x, jnp.ndarray): + if deps.jax_enabled and isinstance(x, jnp.ndarray): return jnp_toeplitz elif deps.cupy_enabled and cp.get_array_module(x) == cp: return cp_toeplitz