-
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
ENH: Improve report usability #12901
Conversation
Okay tests added, this one should be good to go! |
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.
looks good! My suggestions are super minor, feel free to apply them in with ci skip
and manually merge. Thanks @larsoner!
@@ -305,10 +323,18 @@ def plot_head_positions( | |||
|
|||
if destination is not None: | |||
vals = np.array( | |||
[destination[:, 3], rot_to_quat(destination[:, :3])] | |||
[1000 * destination[:3, 3], rot_to_quat(destination[:3, :3])] |
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.
huh, was position previously in meters but labeled as millimeters? oops.
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.
They were in mm before but it was done by modifying destination
inplace earlier. So no bugfix just a change in where the multiplication happens!
Co-authored-by: Daniel McCloy <[email protected]>
* upstream/main: (824 commits) Add `psd_args` to `plot_ica_sources` and `ICA.plot_sources` (mne-tools#12912) Fix GDF NumPy >= 2 (mne-tools#12909) [pre-commit.ci] pre-commit autoupdate (mne-tools#12908) ENH: Improve report usability (mne-tools#12901) MAINT: Avoid problematic PySide6 (mne-tools#12902) Sync README dependencies with pyproject.toml (mne-tools#12890) remove trailing slash from pybv base URL [ci skip] (mne-tools#12892) Cast tuple of filenames to list to improve error handling (mne-tools#12891) Website (mne-tools#12885) [pre-commit.ci] pre-commit autoupdate (mne-tools#12888) BUG: Fix bugs with coreg (mne-tools#12884) Bump mamba-org/setup-micromamba from 1 to 2 in the actions group (mne-tools#12887) Update spacing for comments in pyproject.toml (mne-tools#12886) make HTML repr for Forward match others (mne-tools#12883) MAINT: Linkchecks [circle deploy] (mne-tools#12882) Update roadmap (mne-tools#12872) [MRG] Require good and bad channels when creating a SpectrumArray object (mne-tools#12877) [pre-commit.ci] pre-commit autoupdate (mne-tools#12879) MAINT: Update code credit (mne-tools#12880) BUG: Fix bug with Path casting (mne-tools#12878) ...
I'm using
mne.Report
for some data analyses and hit some limitations. This PR proposes a few different things, quoting the changelog entry:The first is a fairly straightforward improvement to
add_projs
to make use ofplot_projs_joint
instead of plainplot_projs_topomap
when you want to do so.Next is adding a few attributes to
mne.Report
to control behavior of 1) image scaling, and 2) section collapsing. I never liked that I couldn't get full-res images using the default functions likeadd_raw
oradd_projs
, now you can setreport.img_max_width = None
to stop it from shrinking those plots, e.g. on main (you'll need to open separately to see the downscaling quality issue):On this PR you get full res (up to the browser max-width 100% limitation):
And for section collapsing, I added support for collapsing sections and/or subsections by setting
report.collapse = ["section", "subsection"]
. I think this is a good enough start, but I think it's also future compatible with potentially also supporting regex-matching to HTML subsection titles for example.Finally, it adds an option to
plot_head_positions
to summarize the distance and rotation in terms of the vector magnitude and angle. The distance is nice, but the big gain I think is the angle as it's a lot more human-readable than the quats themselves, e.g.:Draft mode since I need to add tests for all of this stuff and modify some examples but I figured I'd open this to get the ball rolling. I could split these off if it would help review, but happy to keep them together if review will be doable with them all in one place. (Or at least the report stuff together in one PR, and the head pos stuff in another.)