BUG: Fix bug with reading old reports#13341
Conversation
mne/report/report.py
Outdated
| for param, default in _backward_compat_map.items(): | ||
| if param not in state: | ||
| state[param] = default |
There was a problem hiding this comment.
[nitpick] I often wonder why folks avoid things like
state = _backward_compat_map.update(state)
# or
for param, default in _backward_compat_map.items():
state[param].setdefault(default)both of which I think yield equivalent results to the pattern implemented here.
Is it just style? Or is there some other reason I'm not aware of?
There was a problem hiding this comment.
The .update works inplace so that won't do what we want (it would modify _backward_compat_map), but the state.setdefault(param, default) is probably okay, I'll push that one! I just don't use it because I see it less and need to check (like I did this time) if it behaves the way you'd expect with regards to actually setting the key in question, etc.
There was a problem hiding this comment.
hah. and I remembered it wrong... but if folks used it more maybe I wouldn't have!
…d reports) (#13344) Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
* upstream: (115 commits) Capitalize Get Help (mne-tools#13340) Website page load fixes (mostly) (mne-tools#13343) MAINT: Restore statsmodels to pip-pre (mne-tools#13345) BUG: Fix bug with reading old reports (mne-tools#13341) [pre-commit.ci] pre-commit autoupdate (mne-tools#13338) MAINT: Fix ref cycle with vtkPolyData (mne-tools#13336) MAINT: Dont set private attributes for PyVista Actor (mne-tools#13334) Add icon links to our donation pages (mne-tools#13331) MAINT: Dont set attribute on PolyData (mne-tools#13330) MAINT: Bump mins, deprecations (mne-tools#13322) Fix changes in SSD for backward compatibility [circle deploy] (mne-tools#13327) ENH: Add GED transformer (mne-tools#13259) FIX: Links MAINT: Stabilize MxNE tests (mne-tools#13321) FIX: DigMontage.rename_channels should return self (mne-tools#13320) MAINT: Prep for release (mne-tools#13319) [pre-commit.ci] pre-commit autoupdate (mne-tools#13317) MAINT: Update code credit (mne-tools#13318) MAINT: Make MxNE test more robust (mne-tools#13315) Adjust Pupil channel units (again) (mne-tools#13314) ...
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Fixes:
or formatted more nicely when added via TDD: