[Biopython-dev] Changing the details of the app wrapper private API

Peter biopython at maubp.freeserve.co.uk
Tue Dec 7 15:45:06 UTC 2010


On Tue, Dec 7, 2010 at 1:29 PM, Brad Chapman <chapmanb at 50mail.com> wrote:
> Peter;
>
> [Internal Application API]
>
>> As you just suggested ("just dump that..."), I did (earlier today)
>> remove the "input" and "output" labels given to the parameters
>> via the types argument. These were only used in the old
>> ApplicationResult object (deprecated and just removed after
>> the release of Biopython 1.56). In addition to these two now
>> useless tags (input and output), there was one other tag "file",
>> and that is still present and used in most if not all the wrappers.
>>
>> It is being used for some important functionality - supporting
>> nasty filenames, in particular those with spaces in them.
>
> Cool, sorry I totally missed this use of the types argument. Glad
> it's actually being useful for something.

Easily done if you haven't been looking at this code for a while ;)

>> I want to keep this functionality, but change the current
>> interface - which is to use types=["file"] or the default of
>> types=[]. The simplest option is to replace it with a
>> boolean (e.g. filename=True, or auto_quote=True).
>
> Definitely a good idea +1 for the filename=True argument to turn on
> quoting. This makes it more clear what is happening, and does give
> you room in case we need other adjustments in the future. I like
> this better than subclassing, since hopefully it's a limited case
> and we won't have to do too much manual adjustment of input
> parameters.

OK, filename=True it is (default False).

https://github.com/biopython/biopython/commit/fd99b976d5775e35cd251a781fb601ffb6906014

Peter

P.S. As part of this work I've also started adding a minimal doctest
to each app wrapper to construct a command line but not actually
call it. These will then be run regardless of the dependency, and
check there are no stupid problems with the wrapper. e.g.
https://github.com/biopython/biopython/commit/6a93cb64e0211a9e061019220f96030871832f9e

The EMBOSS wrappers still need doctests. In hindsight the test
coverage here was a bit lacking.... test_Emboss.py covers a lot
but not all the wrappers.

Note I'm trying to make each example doctest moderately useful to
anyone trying to use the tool for the first time.



More information about the Biopython-dev mailing list