[Biopython-dev] [Bug 2759] Unit test for Bio.PDB.HSExposure

Peter biopython at maubp.freeserve.co.uk
Sun Mar 22 10:51:17 UTC 2009


On Sat, Mar 21, 2009 at 5:13 PM, Eric Talevich <eric.talevich at gmail.com> wrote:
> Giovanni wrote:
>> If you want to use it, the problem is that it make use of a decorator
>> function (@classmethod) which is not supported by earlier versions of
>> python.
>
> Decorators and @classmethod were added in Python 2.4. Since support for
> Python 2.3 is being dropped after the release of BioPython 1.50 (I believe),
> it should be safe to apply the decorator to post-1.50 branches. If this
> needs to be in 1.50, the older way of "mymethod = classmethod(mymethod)"
> would work fine in Py2.3, although I personally would just move the PDB
> loading steps to setUp, since the parser is pretty quick and the code for
> that is easy to read.

Extra PDB unit tests would be nice to have in Biopython 1.50, which means
they must work on Python 2.3, so no decorators please.

I agree with Eric that it is simpler just to use setUp for PDB file
parsing.  Yes,
it is slower as for each test method the PDB file is reloaded - but you also
make sure it is a clean object structure, which is important as some
operations we will testing may change the object.  e.g. HSExposure:
http://bugzilla.open-bio.org/show_bug.cgi?id=2759#c4

Peter



More information about the Biopython-dev mailing list