Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion caiman/utils/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,4 +329,10 @@ def pd_solve(a, b):
if info == 0:
return dpotrs(L, b)[0]
else:
return np.linalg.solve(a, b)
try:
pdsv = np.linalg.solve(a, b)
except LinAlgError :
logger = logging.getLogger("caiman")
logger.warning("Unable to solve directly, using least squares instead.")
pdsv = np.linalg.lstsq(a, b, rcond=None)[0]
return pdsv
Loading