[Biopython-dev] Genepop application wrapper class

Peter biopython at maubp.freeserve.co.uk
Fri Dec 3 20:22:40 UTC 2010


On Fri, Dec 3, 2010 at 2:18 PM, Peter <biopython at maubp.freeserve.co.uk> wrote:
> Hi Tiago,
>
> You may have noticed from the commits recently that I'm looking
> at the application wrappers. There is some "spring cleaning" that
> we can do now that the old ApplicationResult class etc is gone.
>
> As part of this I may need to make internal changes to the
> wrapper _GenePopCommandline regarding how it sets up its
> parameters.
>
> In looking at this I noticed that you seem to be using the
> _Argument class for all the options, where in most cases I
> would have used _Option. For example,
>
> To get e.g. "BatchNumber=5" at the command line via a
> parameter named BatchNumber (as the argument name and
> property name in the wrapper), you have:
>
>                _Argument(["BatchNumber"],
>                    ["input"],
>                    None,
>                    False,
>                    "Number of MCMC batches"),
>
> This means you have to set the value of the BatchNumber
> parameter to "BatchNumber=5" which is repetitive. What I
> would like to change this to is:
>
>                _Option(["BatchNumber"],
>                    ["input"],
>                    None,
>                    False,
>                    "Number of MCMC batches"),
>
> This way you set the value of this parameter to 5 (string or int).
> Since you made this whole class private I think we can change
> these details without affecting the public API (your controller
> class).
>
> Is that OK with you? Or would you like to go through these
> settings since you know the tool better than me?

Hi Tiago,

Since that email I switched the argument order about a bit
(and changed *all* the wrappers to match), so the example
above is a little out of date now.

I've made the _Argument to _Option switch on this branch:
https://github.com/peterjc/biopython/tree/genepop-wrapper

The unit tests pass (including the newly added simple doctest
on the wrapper class), so I'm pretty sure it is OK to use on
the trunk, but I'd like you to check it please.

Thanks,

Peter




More information about the Biopython-dev mailing list