[Biopython-dev] Re: MaxRepeat

Andrew Dalke dalke at acm.org
Sun Nov 5 18:52:39 EST 2000


Cayte:
>I think the problem is that the tech description shows the lower limit
>with a default of 0.  The code has no default for the lower limit.

You're right.  It should have a default min value of 0.

>  The value in the invert parameter is undefined for values other than
> 0 or 1.  2 acts like 0, 3 acts like 1.

Can you give me a test case?  The "invert" option should be a test for
true/false using the Python definition of 0, [], (), {}, all being false
(as well as anything where __nonzero__ or __len__ returns 0) and 1, 2, 3,
...
should all be considered true.

I looked over the code for how invert is used.  There are a few problems
with it, like using 'exp.invert == 0' instead of 'not exp.invert', so
I'll fix those as well, but they won't give the behaviour you're talking
about.

> Today was a cold, rainy Sunday, perfect for coding and testing.

You sure you aren't in Santa Fe? :)  We've had some snow in town, although
it's about 40 degrees so it isn't sticking.  The freeze level seems to
be about 500 feet above us, at least, that's where the snow line appears
on the montains.  Guess winter is settling on everyone - 'cept my family
in Florida.

> My experience that the unit test tool works well for this kind of test
> but not for parsers, where you'd have to drag a lot of context around.

I got that feeling as well.  That's why there ended up being a lot of
test scaffolding for my regression tests, and my tests don't even check
to see if the code matched the right things (they just check to see if
it matched *something*).

I've been tempted to have a set of golden data, with a bunch of data
files for each grammer, then converting the parsed result to a canonical
XML form and comparing the result to the gold reference.

I haven't gone towards it since I get the feeling that that sort of
regression code is too fragile for code still under development.

> Should we be thinking about a Gui for the new parsers?

I'm not sure what that means.  Something like the Tools/redemo.py in the
Python distribution?  That is, a window with two text regions, one to
build the regexp and one containing the text to match.  The regions that
match can be highlighted, perhaps with a mouseover to show the tag name
for a given region.  Umm, that won't work since there can be many tags
describing a region.

                    Andrew





More information about the Biopython-dev mailing list