Skip to content

Conversation

@NatalieNegussie97
Copy link

Hi:)
Clarify the docstring of 'mne.sensitivity_map' to explain available 'mode' options, based on the CLI help text.
No behavioral changes, only documentation improvement.
Closes #12979.

@welcome
Copy link

welcome bot commented Aug 15, 2025

Hello! 👋 Thanks for opening your first pull request here! ❤️ We will try to get back to you soon. 🚴

@wmvanvliet
Copy link
Contributor

The documentation of the various 'mode' options is useful, thanks! However, the other changes to the docstring are deviating from our strict documentation style as the CI robots will tell you.

@drammock
Copy link
Member

thanks for the contribution! easiest way forward is probably to run pre-commit install from the root of your repository clone, and then pre-commit run --all to see what it complains about / auto-fixes. That should hopefully make it easier to get the docstring to match our formatting rules. Once you've done that, feel free to ping with questions about persistent failures / errors you don't understand.

@NatalieNegussie97
Copy link
Author

thanks for the contribution! easiest way forward is probably to run pre-commit install from the root of your repository clone, and then pre-commit run --all to see what it complains about / auto-fixes. That should hopefully make it easier to get the docstring to match our formatting rules. Once you've done that, feel free to ping with questions about persistent failures / errors you don't understand.

Local pre-commit passes. The docstring is fixed. Could you please approve the CI to run?

@drammock
Copy link
Member

Local pre-commit passes. The docstring is fixed. Could you please approve the CI to run?

There's an error in the CIs that already ran, though:

https://app.circleci.com/pipelines/github/mne-tools/mne-python/28359/workflows/a0e833fd-d36c-4ba4-b63b-aa5523515169/jobs/75107

/home/circleci/project/mne/proj.py:docstring of mne.proj.sensitivity_map:20: WARNING: Block quote ends without a blank line; unexpected unindent. [docutils]

If you view the CI's documentation build (by clicking "check the rendered docs here" in the list of CIs, and navigating to the sensitivity_map page), you'll see the docstring looks a bit off:

https://output.circle-artifacts.com/output/job/8f9a6980-3c5f-41b8-9742-79c880e35c70/artifacts/0/html/generated/mne.sensitivity_map.html#mne.sensitivity_map

You can test out your fix by changing to the doc/ folder in your terminal, and running make (which will build the documentation locally) and, when finished, running make show to open a browser window with the locally-built docs site. On that site, press ctrl+k and search for "sensitivity_map" to quickly get to the relevant page, to check if your tweaks have fixed the odd formatting.

When that's done, you can push your changes and the CircleCI build should succeed. Then we'll enable the other CIs :)

mne/proj.py Outdated
projs : list
List of projection vectors.
ch_type : ``'grad'`` | ``'mag'`` | ``'eeg'``
ch_type : {'grad', 'mag', 'eeg'}
Copy link
Member

Choose a reason for hiding this comment

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

revert this change. using | to separate parameter options is how we do it in MNE-Python (see item 3 in this section)

Copy link
Author

Choose a reason for hiding this comment

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

fixed

mne/proj.py Outdated
Comment on lines 397 to 398
mode : {'free', 'fixed', 'ratio', 'radiality', 'angle',
'remaining', 'dampening'}, default='free'
Copy link
Member

Choose a reason for hiding this comment

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

use | (see prior comment). Also, we don't list the default on this line, because users can look at the function signature to see what it is.

Copy link
Author

Choose a reason for hiding this comment

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

fixed

@drammock
Copy link
Member

The parameter description for "mode" still looks wrong, the last 2 possibilities are blockquoted on a separate line.

https://output.circle-artifacts.com/output/job/348218e8-30e1-49fe-aa3d-a887f42a2298/artifacts/0/html/generated/mne.sensitivity_map.html#mne.sensitivity_map

- Add detailed explanations for all mode parameter options
- Clarify the difference between each sensitivity computation method
- Update environment.yml dependencies

Closes mne-tools#12979
@NatalieNegussie97
Copy link
Author

Hi @drammock, I’ve addressed all the issues I could find. pre-commit run --all-files now passes locally, and I built the docs locally and checked the mne.sensitivity_map page. If there’s anything I’ve missed, I’d appreciate pointers. Also, are there other checks I should run locally (beyond pre-commit) to catch “rendered docs” problems earlier? Thanks!

@drammock drammock dismissed wmvanvliet’s stale review August 18, 2025 20:50

stale (all requested changes done)

@drammock drammock enabled auto-merge (squash) August 18, 2025 20:50
auto-merge was automatically disabled August 25, 2025 22:42

Pull request was closed

@larsoner
Copy link
Member

@NatalieNegussie97 did you mean to close this? Looks like it was marked for auto-merge so was about to get in!

@@ -1,82 +1,85 @@
#!/bin/bash
Copy link
Member

@larsoner larsoner Aug 26, 2025

Choose a reason for hiding this comment

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

... but we should git checkout upstream/main tools/get_minimal_commands.sh or so to put this file back to how it was

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

'mode' for mne.sensitivity_map not explained

4 participants