Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions wmpl/Rebound/REBOUND.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
import astropy.time

REBOUND_FOUND = True
rebound_err = None

except ImportError as e:
# Surface the actual import error instead of a generic "not found" message, so a real failure
# (e.g. a broken dependency) isn't misreported as a missing package the user already has.
print("REBOUND/reboundx could not be imported: {}".format(e))
print("Install or upgrade the rebound and reboundx packages to use the REBOUND functions.")
REBOUND_FOUND = False
rebound_err = e

from wmpl.Config import config
from wmpl.Utils.TrajConversions import (
Expand Down Expand Up @@ -893,6 +893,7 @@ def _report(done, t_start):
print("")
print("ERROR: the 'rebound' and 'reboundx' packages are required to run this script, "
"but they could not be imported.")
print("The error was: {}".format(rebound_err))
print("")
print("Install them with: pip install rebound reboundx")
print("")
Expand Down