diff options
author | Mario Mulansky <mario.mulansky@gmx.net> | 2015-12-14 17:25:53 +0100 |
---|---|---|
committer | Mario Mulansky <mario.mulansky@gmx.net> | 2015-12-14 17:25:53 +0100 |
commit | f7b90618f01d4dbf015b3d21c6c06dec8d26bd9f (patch) | |
tree | 799a2fa0e0f7558ece400de15ca8d1358565c066 /pyspike/PieceWiseConstFunc.py | |
parent | d985f3a8de6ae840c8a127653b3d9affb1a8aa40 (diff) | |
parent | 9061f2a0c13134e53f937d730295a421fd671ea3 (diff) |
Merge pull request #20 from mariomulansky/develop
Develop merge for version 0.4
Diffstat (limited to 'pyspike/PieceWiseConstFunc.py')
-rw-r--r-- | pyspike/PieceWiseConstFunc.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/pyspike/PieceWiseConstFunc.py b/pyspike/PieceWiseConstFunc.py index 2705443..5ce5f27 100644 --- a/pyspike/PieceWiseConstFunc.py +++ b/pyspike/PieceWiseConstFunc.py @@ -2,10 +2,11 @@ # Copyright 2014-2015, Mario Mulansky <mario.mulansky@gmx.net> # Distributed under the BSD License -from __future__ import print_function +from __future__ import absolute_import, print_function import numpy as np import collections +import pyspike ############################################################## @@ -188,14 +189,16 @@ class PieceWiseConstFunc(object): # cython version try: - from cython.cython_add import add_piece_wise_const_cython as \ + from .cython.cython_add import add_piece_wise_const_cython as \ add_piece_wise_const_impl except ImportError: - print("Warning: add_piece_wise_const_cython not found. Make sure \ -that PySpike is installed by running\n 'python setup.py build_ext --inplace'! \ + if not(pyspike.disable_backend_warning): + print("Warning: add_piece_wise_const_cython not found. Make \ +sure that PySpike is installed by running\n \ +'python setup.py build_ext --inplace'! \ \n Falling back to slow python backend.") # use python backend - from cython.python_backend import add_piece_wise_const_python as \ + from .cython.python_backend import add_piece_wise_const_python as \ add_piece_wise_const_impl self.x, self.y = add_piece_wise_const_impl(self.x, self.y, f.x, f.y) |