Skip to content

Commit

Permalink
Made pyrr into an optional dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
hpparvi committed Nov 26, 2024
1 parent 64d3ae3 commit 0946559
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pytransit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"""

__version__ = '2.6.12'
__version__ = '2.6.13'

# Generic
# -------
Expand Down
9 changes: 8 additions & 1 deletion pytransit/utils/octasphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@

from math import sin, cos, acos, pi
from numpy import empty, array, vstack, cross, dot
from pyrr import quaternion

try:
from pyrr import quaternion
with_pyrr = True
except ImportError:
with_pyrr = False

def octasphere(ndivisions: int):
"""Creates a unit sphere using octagon subdivision.
Expand All @@ -31,6 +35,9 @@ def octasphere(ndivisions: int):
by Philip Rideout (https://prideout.net/blog/octasphere).
"""

if not with_pyrr:
raise ModuleNotFoundError("The pyrr package is required for GDModel visualization.")

n = 2**ndivisions + 1
num_verts = n * (n + 1) // 2
verts = empty((num_verts, 3))
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@ emcee
pyopencl
corner
celerite
pyrr
meepmeep

0 comments on commit 0946559

Please sign in to comment.