Skip to content

Commit

Permalink
fix scipy import0
Browse files Browse the repository at this point in the history
  • Loading branch information
h-mayorquin committed May 31, 2024
1 parent f9997a9 commit 3b75203
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/spikeinterface/sortingcomponents/motion_estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -959,10 +959,15 @@ def compute_global_displacement(
One of "gradient"
"""
import scipy.sparse
import scipy
from scipy.optimize import minimize
from scipy.sparse import csr_matrix
from scipy.sparse.linalg import lsqr
from scipy.stats import zscore

if convergence_method == "gradient_descent":
size = pairwise_displacement.shape[0]
from scipy.optimize import minimize
from scipy.sparse import csr_matrix

D = pairwise_displacement
if pairwise_displacement_weight is not None or sparse_mask is not None:
Expand Down Expand Up @@ -1005,9 +1010,6 @@ def jac(p):
displacement = res.x

elif convergence_method == "lsqr_robust":
from scipy.sparse import csr_matrix
from scipy.sparse.linalg import lsqr
from scipy.stats import zscore

if sparse_mask is not None:
I, J = np.nonzero(sparse_mask > 0)
Expand Down Expand Up @@ -1043,8 +1045,6 @@ def jac(p):

elif convergence_method == "lsmr":
import gc
from scipy import sparse
from scipy.stats import zscore

D = pairwise_displacement

Expand Down

0 comments on commit 3b75203

Please sign in to comment.