You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
report.add_figure bad tags error not specific enough #10164
Numeric subjects are quite common and I'd imagine a common usecase would be to use numeric tags. I think they should work ... did work previously in rep.add_figs_to_section, so I'd consider this a regression.
Also the docstring talks about "collection of str". I thought "collection" was a matplotlib object? It actually crosslinks to matplotlib. Is that what we mean? Shouldn't it be tuple | list or something like that?
Another issue is that the rep.add_figure closes the figure. I don't think this should happen as user may still like to interact with the matplotlib figure while having it in a report for easier digestion.
Also the docstring talks about "collection of str". I thought "collection" was a matplotlib object? It actually crosslinks to matplotlib. Is that what we mean?
no strong feelings about exposing auto_close. I think if MNE-report creates a figure, it should auto-close, but if user created the figure (as in add_figure), it should not close, by default.
Activity
jasmainak commentedon Dec 29, 2021
Also the docstring talks about "collection of str". I thought "collection" was a matplotlib object? It actually crosslinks to matplotlib. Is that what we mean? Shouldn't it be
tuple | listor something like that?jasmainak commentedon Dec 29, 2021
Another issue is that the
rep.add_figurecloses the figure. I don't think this should happen as user may still like to interact with the matplotlib figure while having it in a report for easier digestion.agramfort commentedon Dec 30, 2021
hoechenberger commentedon Jan 3, 2022
We mean a Python collection / container type, i.e.,
list,set,tuple,array. In the dev docstring, this has already been changed toarray-like: https://mne.tools/dev/generated/mne.Report.htmlHowever we should adjust the error message as well.
We don't allow for certain characters in tags, including spaces.
_fig_to_img()has anauto_closeparameter (defaults toTrue). We could expose this via theadd_figure()API. WDYT?jasmainak commentedon Jan 3, 2022
no strong feelings about exposing
auto_close. I think if MNE-report creates a figure, it should auto-close, but if user created the figure (as inadd_figure), it should not close, by default.hoechenberger commentedon Jan 3, 2022
@jasmainak I think this makes sense, yes!
[-]report.add_figure complains about bad tags[/-][+]report.add_figure bad tags error not specific enough[/+]Better error message for bad tags
report.add_figure bad tags error not specific enough
Better error message for bad tags
MRG: Better error message for bad tags in Report, and allow tags to b…