[Debian-med-packaging] Bug#747494: python3-biopython: Does not use C implementations of cpairwise2 functions

Andreas Tille andreas at an3as.eu
Fri May 9 11:55:44 UTC 2014


Hi,

while I have just closed this bug report since I assumed it was a wrong
usage of the import statement I would like to forward this issue to
upstream Biopython developers anyway.  It seems there are cases when
cpairwise2 is not used and things might work slower than necessary.

I just forward this for your consideration to make sure that everything
works as expected from your side.

Kind regards

        Andreas.

On Fri, May 09, 2014 at 01:32:37PM +0200, Jakub Wilk wrote:
> * Andreas Tille <andreas at an3as.eu>, 2014-05-09, 13:15:
> >thanks for your bug report.  I think this should work out of the
> >box but I personally not comfortable with cpython to know how this
> >could be fixed.  I keep the Debian Python list in CC - perhaps
> >they might have some helpful advise.
> 
> The relvant code in Bio/pairwaise2.py is:
> 
> # Try and load C implementations of functions.  If I can't,
> # then just ignore and use the pure python implementations.
> try:
>    from cpairwise2 import rint, _make_score_matrix_fast
> except ImportError:
>    pass
> 
> But in Python 3 imports as always absolute, unless explicitly
> requested, so the import fails, and this code snippet is no-op.
> Changing the import line to:
> 
>    from .cpairwise2 import rint, _make_score_matrix_fast
> 
> should do the trick.
> 
> Before:
> $ python3 -c 'from Bio.pairwise2 import rint; print(rint.__module__)'
> Bio.pairwise2
> 
> After:
> $ python3 -c 'from Bio.pairwise2 import rint; print(rint.__module__)'
> Bio.cpairwise2
> 
> >It seems this module is not affected by the test suite since this
> >runs fine.
> 
> Yeah, as the code comment says, if the import fails, everything(?)
> still works, just slower.
> 
> -- 
> Jakub Wilk
> 
> _______________________________________________
> Debian-med-packaging mailing list
> Debian-med-packaging at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/debian-med-packaging
> 

-- 
http://fam-tille.de



More information about the Debian-med-packaging mailing list