Commit 3ed27d8f authored by Jérome Perrin's avatar Jérome Perrin

fix dummy simpy implementation

parent 3ffbc9e5
...@@ -25,18 +25,25 @@ Created on 7 May 2013 ...@@ -25,18 +25,25 @@ Created on 7 May 2013
''' '''
main script. Reads data from JSON, generates and runs the simulation and prints the results to excel main script. Reads data from JSON, generates and runs the simulation and prints the results to excel
''' '''
from warnings import warn
import logging
logger = logging.getLogger("dream.platform")
try: try:
import scipy import scipy
except ImportError: except ImportError:
class scipy: class scipy:
class stats: class stats:
@staticmethod @staticmethod
def bayes_mvs(): def bayes_mvs(*args, **kw):
warn("Scipy is missing, using fake implementation") warn("Scipy is missing, using fake implementation")
return [[[0] * 3] * 3] * 3 return [[[0] * 3] * 3] * 3
import sys import sys
sys.modules['scipy.stats'] = scipy.stats sys.modules['scipy.stats'] = scipy.stats
sys.modules['scipy'] = scipy sys.modules['scipy'] = scipy
logger.error("Scipy cannot be imported, using dummy implementation")
from SimPy.Simulation import * from SimPy.Simulation import *
from Source import Source from Source import Source
...@@ -59,10 +66,6 @@ from random import Random ...@@ -59,10 +66,6 @@ from random import Random
import sys import sys
import os.path import os.path
import logging
logger = logging.getLogger("dream.platform")
#reads general simulation inputs #reads general simulation inputs
def readGeneralInput(): def readGeneralInput():
general=G.JSONData['general'] general=G.JSONData['general']
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment