-
-
Notifications
You must be signed in to change notification settings - Fork 211
Configuration ci #1049
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 ci #1049
Conversation
- Add function to set any field in the configuration file - Add function to read out the configuration file - Towards full configurability from CLI
Autocomplete seems to be incompatible with `choices`, so I'll ignore that for now. We also use `config._defaults` instead of an explicit list to avoid duplication.
|
I do notice some downsides to using the set_fields ={}
with open(file, 'r') as fh:
for line in fh.readlines():
field, value = line.split('=', 1)
set_fields[field.strip()] = value.strip()
config = {**_defaults, **set_fields}Not entirely sure if I want to do that right now (I'd like this CLI done before my leave next week, and while simple I feel it should have extensive testing), but do you think we should consider that? |
With the `openml configure FIELD VALUE` command.
Otherwise you have to duplicate all checks in the error message function.
Max_retries is excluded because it should not be user configurable, and will most likely be removed. Verbosity is configurable but is currently not actually used.
And extend it to the bool inputs.
|
Remarks while working on this:
|
* Add a non-functional entry point * Allow setting of API key through CLI - Add function to set any field in the configuration file - Add function to read out the configuration file - Towards full configurability from CLI * Remove autocomplete promise, use _defaults Autocomplete seems to be incompatible with `choices`, so I'll ignore that for now. We also use `config._defaults` instead of an explicit list to avoid duplication. * Add server configuration * Allow fields to be set directly non-interactively With the `openml configure FIELD VALUE` command. * Combine error and check functionalities Otherwise you have to duplicate all checks in the error message function. * Share logic about setting/collecting the value * Complete CLI for other fields. Max_retries is excluded because it should not be user configurable, and will most likely be removed. Verbosity is configurable but is currently not actually used. * Bring back sanitizing user input And extend it to the bool inputs. * Add small bit of info about the command line tool * Add API key configuration note in the introduction * Add to progress log * Refactor flow of wait_until_valid_input
Closes #1045
Adding a CLI which can be used to configure the fields in the configuration file.
This is a draft PR because it's feature incomplete (some fields are missing), but I wanted some input to see if this is an acceptable way to do it.
Installing openml with
pip install openmlwill also add a cli scriptopenml. It'll expect something likeopenml ROUTINE ROUTINE_ARGS, the current routine is onlyconfigure, but I figured some day we might use it for e.g. dataset download.The signature of
openml configurelooks like this:Video of current functionality.
I'm also planning for a direct option that avoids the explanation/interactive routine (e.g.openml config apikey 1234567890abcdef1234567890abcdef).Update: It's also possible to use a non-interactive direct command, e.g.:
openml configure apikey 1234567890abcdef1234567890abcdef.