openml / openml-python

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

[Feature] Environment variable for openml cache #1324

Open eddiebergman opened 6 months ago

eddiebergman commented 6 months ago

This could be useful in certain scenarios where you may have programmatic access before running something but during the execution of the python script, you do not have access to it.

I would recommend something like "OPENML_CACHE_DIRECTORY"?

PGijsbers commented 6 months ago

Note that on Linux we already observe XDG_CACHE_HOME:

https://github.com/openml/openml-python/blob/449f2cb9274a6a4d566748c6f1fdc4b3899482ba/openml/config.py#L106-L109

as proposed in #884.

That said, adding another option (that takes precedence, if set) does not take a lot of work, and would add an environment option with cross-platform support.

eddiebergman commented 6 months ago

The use case just to be more transparent is that I have a cli I can control which launches another script which may use openml but may not necessarily allow a passed in option to set the cache directory.

It's not very problematic in this scenario but I've always been super appreciative of an environment variable in just the right place

PGijsbers commented 6 months ago

Sorry if I sounded negative towards the idea. I do think it's a good suggestion and am in favor of adding it, I just wanted to point out that for some use cases it already kind-of supports what you were asking for.