Climate-REF / Climate-REF/climate-ref
ESMValTool user configuration files are not ignored by the REF
- Dominant language
- Python
- Stars
- 26
- Forks
- 14
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 36
Description
## The problem
Currently, ESMValTool diagnostics are invoked with the [`--config-dir`](https://github.com/Climate-REF/climate-ref/blob/8c26336e4cc6cfa44a165d141602f6ebd5b01494/packages/climate-ref-esmvaltool/src/climate_ref_esmvaltool/diagnostics/base.py#L145) option. This will NOT prevent ESMValTool from parsing user configuration files at `~/.config/esmvaltool/` (see [here](https://docs.esmvaltool.org/projects/ESMValCore/en/latest/quickstart/configure.html#yaml-files)).
This might lead to errors during REF runs or unit tests if the user specified invalid or non-suitable (e.g., additional rootpaths) options in their own configuration file.
## Definition of "done"
ESMValTool should be "encapsulated" within the REF, i.e., tests and runs should be independent from potential ESMValTool user configuration files and not fail because of bad ESMValTool user configuration files.
## Additional context
This can be solved fairly easily by using the environment variable `ESMVALTOOL_CONFIG_DIR` instead of the command line option `--config_dir`. In addition, it would be nice to ensure that potential old configuration files are ignored (requires https://github.com/ESMValGroup/ESMValCore/pull/2736).
Contributor guide
Assessment
This issue has not been assessed yet.