openml / openml-python

Python module to interface with OpenML
https://openml.github.io/openml-python/main/
Other
278 stars 143 forks source link

Support multiple configuration files #1011

Open joaquinvanschoren opened 3 years ago

joaquinvanschoren commented 3 years ago

Say that I want to www.openml.org and test.openml.org. Or I have my own local install and I also want to talk to www.openml.org.

Is this at all possible? I think I can adapt the config settings at any time, e.g. change the server URL, but then I also need to set my new API key etc.

Can we somehow work with 2 config files so that it is easier to switch between servers?

PGijsbers commented 3 years ago

Switching between test and production server is easy:

import openml
# default is production server
openml.config.start_using_configuration_for_example()
# configures to connect to test server with a test api key
openml.config.stop_using_configuration_for_example()
# connect to production server again with original api key

While switching to other servers is not officially supported, I think setting the following would work:

import openml
openml.config.server = 'CUSTOM_SERVER_URL'
openml.config.apikey = 'CUSTOM_SERVER_KEY'

more general switching between configuration files is not supported.

joaquinvanschoren commented 3 years ago

Would it be hard to support multiple configuration files? Of have multiple configurations within one configuration file?

I'm especially thinking of cases where you have your own local install, but you occasionally want to switch to the main openml server to pull in additional datasets or results.

Having multiple config files is probably easier, e.g. a file 'config' for the default settings and 'config_local' for your local settings.

PGijsbers commented 3 years ago

It shouldn't be too hard to add (with separate files being easier). Maybe a day's work to update, test, and document.

mfeurer commented 3 years ago

In case anybody starts working on this, it needs to be based on #987 which is already a great step forward in terms of usability of the config/cache.