[gt-users] warnings
Sascha Steinbiss
steinbiss at zbh.uni-hamburg.de
Wed Jan 6 13:46:22 CET 2010
On 01/05/2010 06:21 PM, Brent Pedersen wrote:
> hi,
Hi Brent,
> how can i turn off warnings from within python.
> when i do:
>
> import gt
> f = gt.FeatureIndexMemory()
> f.add_gff3file("some.gff")
>
> it gives the warnings about:
> warning: seqid "2" on line 2 in file "some.gff" has not been
> previously introduced with a "##sequence-region" line, create such a
> line automatically
I just added support for toggling this from Python (from C it's
trivial). From now on, you can just use gt.warning_disable().
My test case was:
#!/usr/bin/python
import gt
import sys
f = gt.FeatureIndexMemory()
print "disabling warnings"
gt.warning_disable()
f.add_gff3file((sys.argv)[1])
print "re-enabling warnings"
gt.warning_enable_default()
f.add_gff3file((sys.argv)[1])
and it worked:
$ ./testwarn.py ../../gt_stuff/user_examples/example.gff3
disabling warnings
re-enabling warnings
warning: skipping blank line 13 in file
"../../gt_stuff/user_examples/example.gff3"
$
The new code is in the git master or the unstable tarball.
> i also made the change pasted below to stop problems (segfaults) i was
> having when running under modwsgi/apache:
[snip]
Thanks a lot. I will have a look at that and integrate it (though I do
not really get what is fundamentally different now compared to the old
code).
Sascha
--
Sascha Steinbiss
Center for Bioinformatics
University of Hamburg
Bundesstr. 43
20146 Hamburg
Germany
Email: steinbiss at zbh.uni-hamburg.de
URL: http://www.zbh.uni-hamburg.de/steinbiss
Phone: +49 (40) 42838 7322
FAX: +49 (40) 42838 7312
More information about the gt-users
mailing list