Skip to content

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

Closed

Description

@cbrnr

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).

Activity

  1. cbrnr commented on Sep 15, 2022

    @cbrnr
    ContributorAuthor

    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!

  2. changed the title [-]Extend mne.get_config("") to return a dict[/-] [+]Extend `mne.get_config("")` to return a dict[/+] on Sep 15, 2022
  3. drammock commented on Sep 15, 2022

    @drammock
    Member

    I see no downside to always returning the dict

  4. added this to the 1.4 milestone on May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions