mne-python icon indicating copy to clipboard operation
mne-python copied to clipboard

Extend `mne.get_config("")` to return a dict

Open cbrnr opened this issue 1 year ago • 2 comments

mne.get_config("") is mostly there for informational/interactive purposes, it's only used twice in the codebase in ways that should be compatible with dict too:

$ git grep "get_config('')"
mne/utils/tests/test_config.py:24:    assert (len(get_config('')) > 10)  # tuple of valid keys
tutorials/intro/50_configure_mne.py:84:assert 'MNEE_USE_CUUDAA' not in mne.get_config('')

Originally posted by @drammock in https://github.com/mne-tools/mne-python/issues/11159#issuecomment-1247095986

Therefore, mne.get_config("") should return a dict with config values as keys and their descriptions as values (instead of a tuple of just config values without any descriptions).

cbrnr avatar Sep 15 '22 13:09 cbrnr

If we really want to stay compatible, we could also think about adding a new parameter just for this purpose, e.g.

mne.get_config("", extended=True)

The default would be extended=False, which would return the usual tuple of config values.

LMK which option you prefer!

cbrnr avatar Sep 15 '22 13:09 cbrnr

I see no downside to always returning the dict

drammock avatar Sep 15 '22 13:09 drammock