[Biopython-dev] Code review request for phyloxml branch

Michiel de Hoon mjldehoon at yahoo.com
Sun Jan 10 02:50:21 UTC 2010


I think that this code can now be included with Biopython, assuming that there will be some documentation on its usage to accompany it. One more small thing: I noticed when looking at the source code that some comments still refer to Bio.Tree rather than Bio.Phylo -- could you fix this?

Thanks!

--Michiel

--- On Sat, 1/9/10, Eric Talevich <eric.talevich at gmail.com> wrote:

> From: Eric Talevich <eric.talevich at gmail.com>
> Subject: Re: [Biopython-dev] Code review request for phyloxml branch
> To: "Michiel de Hoon" <mjldehoon at yahoo.com>
> Cc: "Peter Cock" <p.j.a.cock at googlemail.com>, "BioPython-Dev Mailing List" <biopython-dev at biopython.org>
> Date: Saturday, January 9, 2010, 6:38 PM
> Hi,
> 
> Thanks for your comments. I've reorganized the modules like
> this:
> 
> Bio/Phylo/
>     __init__.py, BaseTree.py, Newick.py,
> PhyloXML.py, Utils.py
>     IO/
>         __init__.py, NexusIO.py,
> NewickIO.py, PhyloXMLIO.py
> 
> Now "from Bio import Phylo" works for the common cases, and
> "from
> Bio.Phylo.IO import PhyloXMLIO" etc. gives more direct
> access to the
> parsers.
> 
> I renamed TreeIO to Phylo/IO -- keeping it uppercase
> because io is a
> standard module in Py2.6+, Py2.7 changes the priority rules
> for
> absolute vs. relative imports, and Py2.4 doesn't support
> the new
> syntax for relative imports. I might change the other file
> names to
> lower case before the next merge, though...
> 
> On Sat, Jan 9, 2010 at 10:15 AM, Michiel de Hoon <mjldehoon at yahoo.com>
> wrote:
> >
> > Rather than importing *, can we import only those
> functions that a user would actually use? We should avoid
> importing stuff that is essentially used only locally in
> each sub-module.
> >
> > Another option is to have all functions that are
> intended to be used by the user in Bio.Phylo, and have those
> function access (internally) any sub-module as needed. For
> example, a user would not notice that Bio.Phylo.read
> actually uses code from Bio.Phylo.io; the latter module
> would not be accessed directly by the user.
> >
> 
> I'm trying to avoid having to update Phylo/__init__.py each
> time I add
> or rename a public function in Utils.py or IO. So, how
> about this:
> I've added "__all__" definitions to Utils.py and
> IO/__init__.py so
> that only the relevant public functions are loaded when
> Phylo/__init__.py imports * from those two sub-modules.
> Testing
> manually, this seems to do the right thing.
> 
> Cheers,
> Eric
> 


      




More information about the Biopython-dev mailing list