Skip to content

Commit

Permalink
Update deprecated eigh kwarg name
Browse files Browse the repository at this point in the history
  • Loading branch information
moble committed Nov 28, 2023
1 parent 276230a commit 432fd2b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ classifiers = [

dependencies = [
"numpy >=1.20",
"scipy >=1.0",
"scipy >=1.5",
"numba >=0.55; implementation_name == 'cpython'"
]

Expand Down
4 changes: 2 additions & 2 deletions quaternionic/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,15 +248,15 @@ def from_rotation_matrix(cls, rot, nonorthogonal=True):

if not shape:
q = np.empty((4,), dtype=rot.dtype)
eigvals, eigvecs = linalg.eigh(K3.T, eigvals=(3, 3))
eigvals, eigvecs = linalg.eigh(K3.T, subset_by_index=(3, 3))
q[0] = eigvecs[-1]
q[1:] = -eigvecs[:-1].flatten()
return cls(q)
else:
q = np.empty(shape+(4,), dtype=rot.dtype)
for flat_index in range(reduce(mul, shape)):
multi_index = np.unravel_index(flat_index, shape)
eigvals, eigvecs = linalg.eigh(K3[multi_index], eigvals=(3, 3))
eigvals, eigvecs = linalg.eigh(K3[multi_index], subset_by_index=(3, 3))
q[multi_index+(0,)] = eigvecs[-1]
q[multi_index+(slice(1,None),)] = -eigvecs[:-1].flatten()
return cls(q)
Expand Down

0 comments on commit 432fd2b

Please sign in to comment.