[Biopython-dev] Features of the GSOC branch ready to be merged

Eric Talevich eric.talevich at gmail.com
Mon Dec 13 21:28:57 UTC 2010


2010/12/13 Peter <biopython at maubp.freeserve.co.uk>

> 2010/12/13 Eric Talevich <eric.talevich at gmail.com>:
> > Hey folks,
> >
> > 1. For stand-alone functions that don't seem to fit anywhere else, I
> suggest
> > creating a file called _utils.py (rather than Utils.py or Misc.py) --
> this
> > means it's protected, i.e. users know they're not supposed to access it
> > directly -- then import it to the top level in __init__.py:
> >
> > from Bio.PDB._utils import renumber_residues, center_of_mass, ...
> >
> > Then you're allowed to move the functions in that module somewhere else
> > later without going through the usual deprecation process.
>
> On the down side, you'd be adding even more top level functions to
> Bio.PDB.
>
> Shouldn't some of these be methods instead (either returning modified
> objects or acting in situ as appropriate)?
>

Agreed, wherever that's possible. I'm just recommending keeping a
"utils/misc" module as protected in absence of any more informative name for
its contents. If renumber_residues stays as a method on Structure or Entity,
then we don't need a _utils.py yet.

I think the top level is a good place for functions that don't operate on
any particular one of the objects defined in that sub-package -- to use
João's example, joining several PDB files together.

-E




More information about the Biopython-dev mailing list