From: Tim Vieira Date: Wed, 10 Jul 2013 19:21:53 +0000 (-0400) Subject: remove numpy as dep to speed-up load time Issue #44 X-Git-Url: https://hydra-www.ietfng.org/gitweb/?a=commitdiff_plain;h=e2e8db8b9a2db29e842d7d6dd5652fa612d59370;p=dyna2 remove numpy as dep to speed-up load time Issue #44 --- diff --git a/src/Dyna/Backend/Python/stdlib.py b/src/Dyna/Backend/Python/stdlib.py index 921d043..81c62c9 100644 --- a/src/Dyna/Backend/Python/stdlib.py +++ b/src/Dyna/Backend/Python/stdlib.py @@ -3,14 +3,11 @@ from term import Term, Cons, Nil from collections import Counter from utils import pretty, pretty_print -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 math import log, exp, sqrt +from random import random as _random +def uniform(a=0, b=1): + return _random() * (b - a) + a def equals(x,y):