summaryrefslogtreecommitdiff
path: root/pyspike/PieceWiseLinFunc.py
diff options
context:
space:
mode:
authorMario Mulansky <mario.mulansky@gmx.net>2015-07-07 18:55:32 +0200
committerMario Mulansky <mario.mulansky@gmx.net>2015-07-07 18:55:32 +0200
commit5119d47d0f00c3f7203cf94460730b59a7e473ec (patch)
treef17eecd4d2cb7da865b6fe4a1b4faf268ab77334 /pyspike/PieceWiseLinFunc.py
parent0ece782e1579660cdb71e077cbaaf9f76e97bef4 (diff)
add disable_backend_warning property
Users can now disable the warning messages produced when the cython backend is not available by writing spk.disable_backend_warning = True in the beginning
Diffstat (limited to 'pyspike/PieceWiseLinFunc.py')
-rw-r--r--pyspike/PieceWiseLinFunc.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/pyspike/PieceWiseLinFunc.py b/pyspike/PieceWiseLinFunc.py
index c0dd475..0d51c76 100644
--- a/pyspike/PieceWiseLinFunc.py
+++ b/pyspike/PieceWiseLinFunc.py
@@ -6,6 +6,7 @@ from __future__ import print_function
import numpy as np
import collections
+import pyspike
##############################################################
@@ -230,9 +231,11 @@ class PieceWiseLinFunc:
from cython.cython_add import add_piece_wise_lin_cython as \
add_piece_wise_lin_impl
except ImportError:
- print("Warning: add_piece_wise_lin_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.")
+ if not(pyspike.disable_backend_warning):
+ print("Warning: add_piece_wise_lin_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_lin_python as \
add_piece_wise_lin_impl