From: timv Date: Wed, 12 Jun 2013 17:06:03 +0000 (-0400) Subject: drop dep on numpy. X-Git-Url: https://hydra-www.ietfng.org/gitweb/?a=commitdiff_plain;h=0f0e3837e9a105cbbcc291ee078b44adb4f2f42a;p=dyna2 drop dep on numpy. --- diff --git a/src/Dyna/Backend/Python/interpreter.py b/src/Dyna/Backend/Python/interpreter.py index ac2d8cd..0cab7ae 100644 --- a/src/Dyna/Backend/Python/interpreter.py +++ b/src/Dyna/Backend/Python/interpreter.py @@ -4,6 +4,8 @@ TODO ==== + - AggregatorConflict should now always be raised by Dyna compiler. + - vbench: a script which tracks performace over time (= git commits). - profiler workflow @@ -203,8 +205,16 @@ from utils import ip, red, green, blue, magenta, yellow, \ DynaCompilerError, DynaInitializerException, AggregatorConflict from prioritydict import prioritydict from config import dotdynadir, dynahome -from numpy import log, exp, sqrt -from numpy.random import uniform + +try: + from numpy import log, exp, sqrt + from numpy.random import uniform +except ImportError: # XXX: should probably issue a warning. + from math import log, exp, sqrt + from random import random as _random + def uniform(a=0, b=1): + return _random() * (b - a) + a + from time import time