Refactor test_plot_alignment_basic() - #13472
Conversation
| info, | ||
| trans=trans_fname, | ||
| subject="sample", | ||
| subjects_dir=subjects_dir, |
There was a problem hiding this comment.
pull out a shared_kwargs dict with these 4 params, to make clearer which params are different between each call to plot_alignment in this test
There was a problem hiding this comment.
I think this one is still pending
|
@larsoner @drammock Hey Eric, something I noticed while doing this refactor is that our volumetric source space example in our testing data set does not have a value for the subject field, i.e. |
|
We could, but it's also pretty easy to add a instead, which might be preferable anyway since it avoids some boilerplate. There are some similar things here already Line 783 in 7ed5e27 |
|
Code coverage is equal between main and this branch, so I think this is ready to go! |
| pytest.raises( | ||
| TypeError, | ||
| plot_alignment, | ||
| "foo", | ||
| trans_fname, | ||
| subject="sample", | ||
| subjects_dir=subjects_dir, | ||
| ) |
There was a problem hiding this comment.
Let's modernize with context manager
with pytest.raises(..., match="...):
call(...)
| info, | ||
| trans=trans_fname, | ||
| subject="sample", | ||
| subjects_dir=subjects_dir, |
There was a problem hiding this comment.
I think this one is still pending
* upstream/main: (35 commits) Fix bug with coreg scaling (mne-tools#14132) MAINT: Update code credit (mne-tools#14131) Fix bugs with dark mode panels (mne-tools#14109) Improve code credit workflow (mne-tools#14120) Align _AbstractRenderer.tube with the PyVista implementation (mne-tools#14125) Assign instead of compare when marking explicit zeros in spatio_temporal_dist_adjacency (mne-tools#14124) MAINT: Update pre-commit hook versions (mne-tools#14122) MAINT: Update dependency specifiers (mne-tools#14121) fix: correct typo in comment (mne-tools#14117) [dependabot]: Bump the actions group with 2 updates (mne-tools#14123) Fix` read_raw_eyelink()` failure when recording blocks are empty or starting with empty values (mne-tools#13571) ENH: Add `event_key` parameter to `read_raw_egi` for MFF event metadata (mne-tools#14086) fix for scipy sparse deprecations (mne-tools#14118) Fix notch spectrum fit (mne-tools#14116) Speed up notch filter spectrum fit (mne-tools#14114) fix MNE-RT links and update roadmap (mne-tools#14096) Clarify `docdict["filter_length_notch"]` (mne-tools#14113) Refactor test_plot_alignment_basic() (mne-tools#13472) BUG: Cleanup cHPI filtering using smooth interpolation (mne-tools#14112) Use redirector app (mne-tools#14111) ... # Conflicts: # mne/tests/test_filter.py
What does this implement/fix?
This is a PR to simplify an overly long and complicated test in the testing suite for #D visualization. This refactor breaks testing of the function
mne.viz.plot_alignmentinto manageable chunks, separating tests of different parameters, and separating error checking from test plots (except where doing so would add extra up front instantiations).