Skip to content

Commit

Permalink
Added import error for scipy Rotation
Browse files Browse the repository at this point in the history
  • Loading branch information
ceriottm committed Aug 28, 2023
1 parent 6059ae2 commit 8c87fcc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions python/chemiscope/structures/_shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,12 @@ def ellipsoid_from_tensor(tensor, scale=1.0, force_positive=False):
rotation = eigenvectors.T

# converts to quaternion
from scipy.spatial.transform import Rotation

try:
from scipy.spatial.transform import Rotation
except ImportError as e:
raise RuntimeError(
"scipy is required to construct arrow shapes"
) from e
quaternion = Rotation.from_matrix(rotation).as_quat()

return dict(
Expand Down

0 comments on commit 8c87fcc

Please sign in to comment.