diff --git a/pyRDDLGym/core/intervals.py b/pyRDDLGym/core/intervals.py index d1cf9e92..07c845e9 100644 --- a/pyRDDLGym/core/intervals.py +++ b/pyRDDLGym/core/intervals.py @@ -1,6 +1,16 @@ +import traceback import numpy as np -from scipy.special import gamma -import scipy.stats as stats + +# try to load scipy +try: + from scipy.special import gamma + import scipy.stats as stats +except Exception: + raise_warning('failed to import scipy: ' + 'some interval arithmetic operations will fail.', 'red') + traceback.print_exc() + gamma = None + stats = None from typing import Dict, Optional, Tuple from enum import Enum @@ -22,6 +32,7 @@ class IntervalAnalysisStrategy(Enum): + '''Specifies how bounds on random variables should be propagated.''' SUPPORT = 1 PERCENTILE = 2 MEAN = 3 diff --git a/requirements.txt b/requirements.txt index 41730220..37aa58a6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,5 +4,4 @@ gymnasium numpy>=1.22 pygame ply -scipy termcolor \ No newline at end of file