Skip to content

Commit 0946559

Browse files
committed
Made pyrr into an optional dependency.
1 parent 64d3ae3 commit 0946559

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

pytransit/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
4242
"""
4343

44-
__version__ = '2.6.12'
44+
__version__ = '2.6.13'
4545

4646
# Generic
4747
# -------

pytransit/utils/octasphere.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,12 @@
2121

2222
from math import sin, cos, acos, pi
2323
from numpy import empty, array, vstack, cross, dot
24-
from pyrr import quaternion
2524

25+
try:
26+
from pyrr import quaternion
27+
with_pyrr = True
28+
except ImportError:
29+
with_pyrr = False
2630

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

38+
if not with_pyrr:
39+
raise ModuleNotFoundError("The pyrr package is required for GDModel visualization.")
40+
3441
n = 2**ndivisions + 1
3542
num_verts = n * (n + 1) // 2
3643
verts = empty((num_verts, 3))

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,4 @@ emcee
1717
pyopencl
1818
corner
1919
celerite
20-
pyrr
2120
meepmeep

0 commit comments

Comments
 (0)