Skip to content

Commit

Permalink
Make it black complaint
Browse files Browse the repository at this point in the history
  • Loading branch information
pabloferz authored Aug 15, 2024
1 parent caa41c0 commit 3058016
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 10 additions & 1 deletion pysages/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,14 @@
solve_pos_def,
try_import,
)
from .core import ToCPU, copy, dispatch, eps, first_or_all, gaussian, identity, linear_solver
from .core import (
ToCPU,
copy,
dispatch,
eps,
first_or_all,
gaussian,
identity,
linear_solver,
)
from .transformations import quaternion_from_euler, quaternion_matrix
2 changes: 0 additions & 2 deletions pysages/utils/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,11 @@ def linear_solver(use_pinv: bool):
(this is computationally more expensive but numerically more stable).
"""
if use_pinv:

# This is numerically more robust
def tsolve(A, B):
return np.linalg.pinv(A.T) @ B

else:

# Another option to benchmark against is `linalg.tensorsolve(A @ A.T, A @ B)`
def tsolve(A, B):
return solve_pos_def(A @ A.T, A @ B)
Expand Down

0 comments on commit 3058016

Please sign in to comment.