Skip to content

Conversation

@shruti423
Copy link

Reference Issues/PRs

Fixes #12197

What does this implement/fix?

This PR updates the docstring of get_data in mne/io/base.py.
It explicitly states that bad channels are included by default when picks=None, as requested in the issue. This prevents user confusion about the default behavior.

Any other comments?

I replaced the %(picks_all)s substitution with the explicit text to add the warning note.

mne/io/base.py Outdated
['MEG0111', 'MEG2623']) will pick the given channels. Can also be the
string values "all" to pick all channels, or "data" to pick data
channels. None (default) will pick all channels. Note that channels in
``info['bads']`` *will be included* by default.
Copy link
Member

Choose a reason for hiding this comment

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

maybe the docdict in docs.py should rather be updated. Can you check?

Copy link
Author

Choose a reason for hiding this comment

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

Thanks @agramfort! That makes sense. I have updated the global template in mne/utils/docs.py to include the warning, and I reverted the local change in base.py. The changes are pushed now.

Copy link
Author

Choose a reason for hiding this comment

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

I am getting a block-unregistered-user error on CircleCI. I tried to sign up to fix it, but the login page is not showing the GitHub option for me. Could a maintainer please manually approve the workflow run? Thanks!

@larsoner
Copy link
Member

Can you get pytest mne/tests/test_docstring_parameters.py working locally first then push? You can see it failing on remote CIs but that takes ~60 min per run to tell you, so locally testing first is better. Once that's green I'll approve the CircleCI run

@shruti423
Copy link
Author

@larsoner I have fixed the docstring issues. I ran pytest mne/tests/test_docstring_parameters.py locally as requested, and it is now passing (Green). I pushed the fixes, so the CI should be happy now!

@larsoner
Copy link
Member

The diff currently shows no files changed, can you make sure the Files tab looks like you want?

https://github.com/mne-tools/mne-python/pull/13543/changes

@shruti423
Copy link
Author

Hi @larsoner, I sincerely apologize for the confusion with the previous commits. As a beginner, I got mixed up while trying to fix the local build errors and accidentally reset the file content, resulting in an empty PR.

I have now verified the fix locally:

  1. Edited mne/utils/docs.py to include the clarification in picks_all.
  2. Verified base.py uses this key.
  3. Ran pytest mne/tests/test_docstring_parameters.py and it passed.

I just pushed the correct changes. Thank you for your patience!

{_picks_desc} {_picks_int} {_picks_str}"""
picks_base_notypes = f"""picks : list of int | list of str | slice | None
{_picks_desc} {_picks_int} {_picks_str_notypes}"""
docdict["picks_all"] = _reflow_param_docstring(f"{picks_base} all channels. {reminder}")
Copy link
Member

Choose a reason for hiding this comment

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

The old code had a space between the period and the {reminder}, yours does not. I suspect this will lead to something like "end of sentence.Nospace before next", but it's possible we had it wrong before and what you now have is correct. Can you check?

@shruti423
Copy link
Author

Thanks for catching that! I checked locally and confirmed the space was missing. I've pushed a fix.

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.

.get_data()'s picks docstring does not explicitly state that bad channels are included by default

3 participants