Skip to content
Draft
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions stistools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from __future__ import absolute_import
from .version import *

from .r_util import check_hstcal_status
check_hstcal_status() # Is the 'hstcal' dependency installed?

from . import calstis
from . import basic2d
from . import ocrreject
Expand Down
9 changes: 9 additions & 0 deletions stistools/r_util.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import os.path
import copy
import shutil


NOT_APPLICABLE = 'n/a'
Expand Down Expand Up @@ -84,3 +85,11 @@ def interpolate(x, values, xp):
break

return value


def check_hstcal_status():
on_readthedocs = os.environ.get('READTHEDOCS', 'False') == 'True'

if not on_readthedocs and not shutil.which('cs0.e'):
raise ImportError("The 'hstcal' package binaries were not found in $PATH. "
"Please check that it is installed.")