Skip to content

Conversation

@sappelhoff
Copy link
Member

I would be happy to receive some guidance on how to properly deprecate the subject parameter, the situation seems a bit tricky to me, given the mixture of positional parameters.

Comment on lines 97 to 99
subjects,
runs,
*,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this I'd be tempted just to live with the misnomer subject=[...] rather than switch to subjects=[...] but the deprecation also won't be so terrible:

def load_data(
    subjects=None,
    runs=None,
    *,
    subject=None,
    ...
):
    if subject is not None:
        subjects = subjects
        warn(..., FutureWarning)
    del subject

And then you'll need to ensure that subjects and runs are not None, i.e., the user has actually supplied values for them (raise an error if None). Then once deprecation is complete we can remove the =None defaults safely.

Copy link
Member

@larsoner larsoner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks @sappelhoff !

@larsoner larsoner enabled auto-merge (squash) October 28, 2024 13:58
@larsoner larsoner disabled auto-merge October 28, 2024 13:59
@larsoner larsoner enabled auto-merge (squash) October 28, 2024 13:59
@larsoner larsoner merged commit e15292f into mne-tools:main Oct 28, 2024
@sappelhoff sappelhoff deleted the eegbci branch October 28, 2024 15:31
larsoner added a commit to larsoner/mne-python that referenced this pull request Oct 28, 2024
* upstream/main:
  eegbci api: allow downloading multiple subjects (mne-tools#12918)
  DOC: Document Linux desktop workaround (mne-tools#12900)
  Allow exporting edf where a channel contains only constant values (mne-tools#12911)
  Autogenerate environment.yml file from pyproject.toml (mne-tools#12914)
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 this pull request may close these issues.

2 participants