[Biopython-dev] PEP8 lower case module names?

Peter Cock p.j.a.cock at googlemail.com
Thu Sep 6 07:06:07 UTC 2012


On Thu, Sep 6, 2012 at 7:31 AM, Michiel de Hoon wrote:
> [Brad]
>> Hack together something that will remove old 'Bio' modules
>> on install of the new version.
>
> We could check in setup.py if we can import Bio, and ask
> the user to remove the old Biopython installation before
> proceeding. Since we can tell the user exactly which directory
> to remove, this would be straightforward. I would prefer this
> to removing the directory automatically.

I agree automatically removing the old install is risky.

For single user machines, where the single user has only a
small collection of scripts this isn't such an issue. For any
shared server, or user with lots of Biopython scripts (some
of which may have been written by different people), you
would be forced into a mass change at one go.

You would also have considerable hassle later on with any
attempt to re-run old scripts.

> [Peter]
>> I really don't like using "bio" since (due to Python's use
>> of folders for package names) you couldn't in general also
>> have the old code available under "Bio". i.e. This forces
>> a hard switch on our users which is a very bad idea I think.
>
> I don't see why a user would like to have both an old
> Biopython under Bio and a new Biopython under bio.
> Unless he wants to run some scripts with the old Biopython
> and other scripts with the new Biopython, but I don't see
> the point of that.

Really? That is exactly what I am concerned about (both
for single user machines like my desktop, and shared
machines like our servers). How about the common
situation of wanting to re-run old scripts from old
projects on new data?

If we were just changing the case, this might not be
too complex (it would still be a frustrating transition
period), but if we're also moving things around at the
same time it is too much I feel.

> [Peter]
>> Thus my suggestion of something else like "biopy" [...]
>> , or if not already taken "bp".
>
> [Brad]
>> However, my vote would be to stick with everything as is.
>
> If the choice is between "bp", "biopy", or "Bio", then
> I agree with Brad; I prefer keeping a nice but
> PEP8-noncompliant module name "Bio" rather than
> switching to a PEP8-compliant but less attractive
> name like "biopy" or "bp".

There is 'biopython' but it is rather long? No other ideas
from anyone else?

How about over the next year we gradually consolidate
modules under the existing mixed case names? e.g.
move Bio.AlignIO functionality and Bio.Align, and
Bio.Seq* under Bio.Seq (leaving backwards compatible
imports supported but deprecated).

Here's a further (and slightly more radical) idea: We
stick with using 'Bio' and the current mixed case
names on Python 2, but adopt 'bio' and other PEP8
compatible names for Python 3 (as a uniform
strict automatic rule: mixed case -> lower case)?
i.e. Do this as part of our 2to3 process.

Some nasty downside might occur to me later
but right now it seems like a neat idea... other
that not being quite in line with the expectation
that Python 3 should not be used as an excuse
to make API changes. Too radical?

Regards,

Peter



More information about the Biopython-dev mailing list