Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unified command line interface #139

Open
philippkraft opened this issue Mar 7, 2018 · 3 comments
Open

Unified command line interface #139

philippkraft opened this issue Mar 7, 2018 · 3 comments

Comments

@philippkraft
Copy link
Collaborator

It would be nice to be able to set the sampler arguments with command line options. All we need is a module using the argparse module. Proposed usage in code:

if __name__ == '__main__':
    model = spot_setup()
    sampler = spotpy.cli(model)

Usage exampler from the command line

$ python tutorial_cmf_lumped.py --sampler lhs --runs 1000 --dbname lumped_output --dbformat csv --parallel seq
$ python tutorial_cmf_lumped.py lhs -n 1000 -o lumped_output -f csv -p seq

Even better if all options can also be set via environmental variables, eg. SPOTPY_SAMPLER, SPOTPY_RUNS

@havanagrawal
Copy link
Contributor

I'd like to work on this please!

@philippkraft
Copy link
Collaborator Author

Would be super - I don't have the time for it. How about an early WIP pull request, for a joint discussion on the design and naming?

In fact, this idea was inspired by #120 and my clumsy pseudo interface in spot_setup_cmf_lumped.py (I made real argparseinterfaces in the past, they work well but not easy to make in a hurry).

A third configuration source could be a configuration file.

philippkraft pushed a commit to philippkraft/spotpy that referenced this issue Aug 28, 2018
philippkraft pushed a commit to philippkraft/spotpy that referenced this issue Aug 28, 2018
philippkraft pushed a commit to philippkraft/spotpy that referenced this issue Aug 28, 2018
@thouska
Copy link
Owner

thouska commented Sep 4, 2018

The Command Line Interface should be available now, general use can be found in #174.
Whats still missing is a short explanation in the documentation, which is why I leave this issue open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants