-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[MRG] Improve docstring format and support floats for conductivity in make_bem_model #12020
Conversation
This reverts commit c728bd7.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, didn't notice this was in draft mode when I started reviewing. Stopping mid-way. Ping when ready for a complete review
Co-authored-by: Daniel McCloy <dan@mccloy.info>
The cookbook! I can't believe it took me so long to discover this lovely page! A grep on To my knowledge (and I've been digging around during a good part of my afternoon), that's the only document which chains all the operation needed to get from a |
see #6778 |
Co-authored-by: Daniel McCloy <dan@mccloy.info>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR adds x-ref and style fixes to docstrings + the 3 code changes listed below.
conductivity = np.array(conductivity, float) | ||
conductivity = np.atleast_1d(conductivity).astype(float) | ||
if conductivity.ndim != 1 or conductivity.size not in (1, 3): | ||
raise ValueError("conductivity must be 1D array-like with 1 or 3 " "elements") | ||
raise ValueError( | ||
"conductivity must be a float or a 1D array-like with 1 or 3 elements" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First code-change in this PR, supporting floats directly for conductivity
instead of array of shape (1, )
for single-layer model.
mne/source_space/_source_space.py
Outdated
n_jobs=None, | ||
*, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Second code change, add the argument n_jobs
to setup_volume_source_space
used by _make_volume_source_space
.
sharex=True, | ||
sharey=False, | ||
figsize=(8.8, 2.2 * n_rows), | ||
constrained_layout=True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some minor comments, otherwise looks great!
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
@mscheltienne don't forget to ping us after you push commits assuming you're done, I have turned off commit notifications in my GitHub preferences (and I assume many other maintainers have as well)! I should be able to look and merge tomorrow |
Sure, no hurry on that one ;) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx @mscheltienne
… make_bem_model (mne-tools#12020) Co-authored-by: Daniel McCloy <dan@mccloy.info> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
make_bem_model
on top of arrays of shape (1,).