Skip to content

Commit

Permalink
Scipy is an optional requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-gimelfarb committed Nov 22, 2024
1 parent 97647cd commit b6c3b77
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
15 changes: 13 additions & 2 deletions pyRDDLGym/core/intervals.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -22,6 +32,7 @@


class IntervalAnalysisStrategy(Enum):
'''Specifies how bounds on random variables should be propagated.'''
SUPPORT = 1
PERCENTILE = 2
MEAN = 3
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ gymnasium
numpy>=1.22
pygame
ply
scipy
termcolor

0 comments on commit b6c3b77

Please sign in to comment.