Skip to content
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

Extend mne.get_config("") to return a dict #11164

Closed
cbrnr opened this issue Sep 15, 2022 · 2 comments · Fixed by #11166
Closed

Extend mne.get_config("") to return a dict #11164

cbrnr opened this issue Sep 15, 2022 · 2 comments · Fixed by #11166
Milestone

Comments

@cbrnr
Copy link
Contributor

cbrnr commented Sep 15, 2022

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 #11159 (comment)

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
Copy link
Contributor Author

cbrnr commented Sep 15, 2022

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 cbrnr changed the title Extend mne.get_config("") to return a dict Extend mne.get_config("") to return a dict Sep 15, 2022
@drammock
Copy link
Member

I see no downside to always returning the dict

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants