[Bioperl-l] Bio::Tools::Primer3.pm bug: code or doc, you decide???

George Hartzell hartzell at kestrel.alerce.com
Tue Jun 14 13:48:48 EDT 2005


Brian Osborne writes:
 > George,
 > 
 > You're presenting a good argument that it's the code that should change.
 > 
 > Brian O.
 > 
 > 
 > On 6/12/05 6:09 PM, "George Hartzell" <hartzell at kestrel.alerce.com> wrote:
 > 
 > > 
 > > The pod for Bio::Tools::Primer3::number_of_results says for Function:
 > > 
 > >    "Retrieve the number of primers returned from Primer3"
 > > 
 > > and for it's Notes:, it says
 > > 
 > >    "Returns the maximum number of primers returned from Primer3."
 > > 
 > > In fact, it's returning the maximum offset of the array of results,
 > > also known as one *less* than the number of results that primer3
 > > returned....  (see Bio::Tools::Primer3::_separate() and it's use of
 > > $maxlocation and $self->{'maximum_primers_returned'}).
 > > 
 > > Given the method's *name*, I figured it'd tell me how many primers I'd
 > > gotten back from primer3.
 > > 
 > > Given the method's Function doc, ditto....
 > > 
 > > Given the method's Notes, it's a bit fuzzier, but it still evokes a
 > > count.
 > > 
 > > I'd like to fix *something*, so that I'll feel better about wasting an
 > > hour walking the primer3 C code and pestering the authors about an off
 > > by one bug.....
 > > 
 > > So, should I change the method to add one, or change the documentation
 > > to specify that it's the maximum offset into the results array (even
 > > though the names then misleading).
 > > 
 > > I'd rather fix the code, but *I* don't have to be backward
 > > compatible....
 > > 
 > > Comments?

Here's a patch that fixes it.

It changes the behaviour, code that used to work will now have an off
by one error.

There should be a "Headsup!  We just made a non-backward-compatible
change" warning if when this gets committed.

g.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-Primer3.pm
Type: application/octet-stream
Size: 942 bytes
Desc: not available
Url : http://portal.open-bio.org/pipermail/bioperl-l/attachments/20050614/c27aff49/patch-Primer3.obj


More information about the Bioperl-l mailing list