diff options
author | Mario Mulansky <mario.mulansky@gmx.net> | 2015-07-07 18:55:32 +0200 |
---|---|---|
committer | Mario Mulansky <mario.mulansky@gmx.net> | 2015-07-07 18:55:32 +0200 |
commit | 5119d47d0f00c3f7203cf94460730b59a7e473ec (patch) | |
tree | f17eecd4d2cb7da865b6fe4a1b4faf268ab77334 /pyspike/spike_distance.py | |
parent | 0ece782e1579660cdb71e077cbaaf9f76e97bef4 (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/spike_distance.py')
-rw-r--r-- | pyspike/spike_distance.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pyspike/spike_distance.py b/pyspike/spike_distance.py index dd6d4f8..feea0c1 100644 --- a/pyspike/spike_distance.py +++ b/pyspike/spike_distance.py @@ -2,6 +2,7 @@ # Copyright 2014-2015, Mario Mulansky <mario.mulansky@gmx.net> # Distributed under the BSD License +import pyspike from pyspike import PieceWiseLinFunc from pyspike.generic import _generic_profile_multi, _generic_distance_multi, \ _generic_distance_matrix @@ -34,7 +35,8 @@ def spike_profile(spike_train1, spike_train2): from cython.cython_profiles import spike_profile_cython \ as spike_profile_impl except ImportError: - print("Warning: spike_profile_cython not found. Make sure that \ + if not(pyspike.disable_backend_warning): + print("Warning: spike_profile_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 |