Skip to content

Commit

Permalink
Merge pull request #3736 from alejoe91/fix-sc2
Browse files Browse the repository at this point in the history
Warn instead of print in solve_monopolar
  • Loading branch information
alejoe91 authored Mar 5, 2025
2 parents 49dbcc6 + ba4c343 commit 1df6d1c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/spikeinterface/postprocessing/localization_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ def solve_monopolar_triangulation(wf_data, local_contact_locations, max_distance
output = scipy.optimize.least_squares(estimate_distance_error, x0=x0, bounds=bounds, args=args)
return tuple(output["x"])
except Exception as e:
print(f"scipy.optimize.least_squares error: {e}")
warnings.warn(f"scipy.optimize.least_squares error: {e}")
return (np.nan, np.nan, np.nan, np.nan)

if optimizer == "minimize_with_log_penality":
Expand All @@ -378,7 +378,7 @@ def solve_monopolar_triangulation(wf_data, local_contact_locations, max_distance
alpha = (wf_data * q).sum() / np.square(q).sum()
return (*output["x"], alpha)
except Exception as e:
print(f"scipy.optimize.minimize error: {e}")
warnings.warn(f"scipy.optimize.minimize error: {e}")
return (np.nan, np.nan, np.nan, np.nan)


Expand Down

0 comments on commit 1df6d1c

Please sign in to comment.