[Biopython-dev] Bio/cMarkovModelmodule.c
Peter
biopython at maubp.freeserve.co.uk
Wed Nov 3 12:45:25 EDT 2010
On Sat, Oct 30, 2010 at 3:23 PM, Michiel de Hoon <mjldehoon at yahoo.com> wrote:
>
> OK, done. In the end, I put the warning message in MarkovModel.py anyway,
> since it's very easy to miss if it's in setup.py.
>
Do we really need the warning? I guess otherwise people using this code
might notice a drop in performance if they were using our C code version,
updated their Biopython, and then get the Python fallback if their NumPy
is too old.
If we do keep the warning should it be silenced in test_MarkovModel.py?
Something like the patch below should do it...
Peter
diff --git a/Tests/test_MarkovModel.py b/Tests/test_MarkovModel.py
index fc5ae8b..bb3afe8 100644
--- a/Tests/test_MarkovModel.py
+++ b/Tests/test_MarkovModel.py
@@ -9,7 +9,12 @@ except ImportError:
raise MissingPythonDependencyError(\
"Install NumPy if you want to use Bio.MarkovModel.")
+import warnings
+#Silence this warning:
+#For optimal speed, please update to Numpy version 1.3 or later
+warnings.filterwarnings("ignore", category=UserWarning)
from Bio import MarkovModel
+warnings.filters.pop()
def print_mm(markov_model):
print "STATES: %s" % ' '.join(markov_model.states)
More information about the Biopython-dev
mailing list