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

Configuration File #95

Open
dwysocki opened this issue Dec 26, 2015 · 0 comments
Open

Configuration File #95

dwysocki opened this issue Dec 26, 2015 · 0 comments

Comments

@dwysocki
Copy link
Member

It can be tedious providing all of the necessary arguments to Plotypus, and if you're reusing the same ones over and over, it would be nice to be able to save them to a config file. Also, new users are likely to be overwhelmed by the number of available parameters, so if we could simply provide several files with reasonable defaults for various usages, that would be useful.

For this reason, I think we should add support for a configuration file, which would provide default values for arguments. The variables in the config file would have names identical to the CLI arguments.

Take, for example, the following call to plotypus.

$ plotypus --input foo/bar.dat --period 12.34

One could instead create a config file

# foo.conf
input = foo/bar.dat
period = 12.34

and call it with

$ plotypus --config foo.conf

and to override the input file, run

$ plotypus --config foo.conf --input bar/baz.dat

We could also have an option which causes the built-in defaults to be printed to stdout, which would make for a good starting point for making a custom config file, which does not break (as easily) when plotypus is upgraded.

$ plotypus --config-defaults > default.conf

I found two packages made to serve this purpose (ConfigArgParse and argparse_config), as well as a StackOverflow post, which suggests several approaches.

I suggest not starting work on this until more pressing issues are taken care of, but it will probably be simple enough to fit into the next release.

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

No branches or pull requests

1 participant