[Biopython-dev] ApplicationResult and generic_run obsolete?

Bartek Wilczynski bartek at rezolwenta.eu.org
Mon Jul 6 15:35:53 EDT 2009


On Mon, Jul 6, 2009 at 9:02 PM, Peter<biopython at maubp.freeserve.co.uk> wrote:
> Hi all,
>
Hi,

> this object gets used in the function generic_run. So we'd have to
> obsolete that too. [If anyone can see any other side effects of
> deprecating Bio.Application.ApplicationResult please speak up]

I'm fine with deprecating ApplicationReslut.

> Personally when running a sub-process I have either wanted the stdout
> (and stderr) handles, OR the return code (and I don't have about
> stdout and stderr). I can't think of a situation off hand where I
> needed both. So for me, the Bio.Application.generic_run function isn't
> very helpful.
>
Well, I don't have too much experience with writing application wrappers,
but I can easily think of the scenario when I first check whether the program
returned the "right" error code and then if it's fine I would process
the stdout.

> If we want to deprecate Bio.Application.generic_run (in order to
> deprecate Bio.Application.ApplicationResult), then do we need a
> replacement? Or replacements?
>
> (b) Returns the return code (integer) plus the stdout and stderr
> (which would have to be StringIO handles, with the data in memory).
> This would be a direct replacement for the current
> Bio.Application.generic_run function.

That sounds like a good replacement.

> However, I'm tempted to say Biopython shouldn't be duplicating basic
> Python functionality, like wrapping the subprocess module in helper
> functions for typical situations. Instead we should just document
> using the current recommend Python best practice (which I believe to
> be use the subprocess module). The downside is that using subprocess
> is a bit tricky for novices.
>

I don't have strong feelings about that, but my personal experience is that it
helps to have some infrastructure which (even if providing somewhat superfluous
API layer over the bare python libs), especially for people who may
have limited
experience with different platforms.

I, for one, would find it useful if biopython provided a simple
classes which allowed
people to write cross-platform wrappers for command line tools.

cheers
Bartek


More information about the Biopython-dev mailing list