Describe the new feature or enhancement
mne/viz/_brain/_brain.py is currently over 5k lines and all in one Brain class which makes adding new features and debugging difficult. also as mentioned by @wmvanvliet:
The _brain.py code is become too long though. We should split it up into multiple files at some point.
``
Describe your proposed implementation
I would suggest using mixing classes (as it also been used at other places like BaseRaw and BaseEpochs) sth like:
@fill_doc
class Brain(
_SourceDataMixin, # add_data, add_label, add_annotation, _add_volume_data, ...
_ObjectsMixin, # add_forward/dipole/head/skull/volume_labels/foci/sensors/text
_ScalarDataMixin, # update_lut, colormap range, time interpolation, _update_glyphs
_AppearanceMixin, # set_surf, set_cortex_colormap, silhouette
_CameraMixin, # show_view, _set_camera, reset_view
_PickingMixin, # picking, hover, glyphs, mpl traces
...
)
and a _helpers.py for taking the module level helpers (e.g. _safe_interp1d, _update_limits, ...).
Do you agree with this approach? @larsoner @wmvanvliet , also consider that mixins will be single use. also I would like to wait until we finally decide on the skeleton, for example I'm not sure if we need _events.py for ui_events handlers or should we put plot_time_course into picking or sth like _traces.py.
Describe possible alternatives
.
Additional context
No response
Describe the new feature or enhancement
mne/viz/_brain/_brain.pyis currently over 5k lines and all in oneBrainclass which makes adding new features and debugging difficult. also as mentioned by @wmvanvliet:``
Describe your proposed implementation
I would suggest using mixing classes (as it also been used at other places like
BaseRawandBaseEpochs) sth like:and a
_helpers.pyfor taking the module level helpers (e.g._safe_interp1d,_update_limits, ...).Do you agree with this approach? @larsoner @wmvanvliet , also consider that mixins will be single use. also I would like to wait until we finally decide on the skeleton, for example I'm not sure if we need
_events.pyforui_eventshandlers or should we putplot_time_courseinto picking or sth like_traces.py.Describe possible alternatives
.
Additional context
No response