Splitting _brain.py into multiple modules
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
The issue is about refactoring mne/viz/_brain/_brain.py into multiple modules using mixins. Start by examining the current Brain class structure and the proposed mixin categories. Look at how BaseRaw and BaseEpochs use mixins in the codebase. Determine which methods belong to each mixin and create separate files for them. Testing involves ensuring the Brain class still works after the split.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Python
- Star
- 3.5k
- Fork
- 1.6k
- Merge trung bình
- 1 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 72
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của mne-tools/mne-python
-
ENH: Add `description` filter parameter to `Raw.crop_by_annotations()`Có thể đã có người làm @aman-coder03 đã nhận 194 ngày trước. Đang mởENH
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
mne-tools/mne-python#13743 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
BUG
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 78/100
mne-tools/mne-python#14431 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
mne-tools/mne-python#14428 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ENH
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
mne-tools/mne-python#14427 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Possible scaling error for 0 and Nyquist frequencies in multitaper spectraCó thể đã có người làm @badrisatyam1-ctrl đã nhận hôm nay. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 56/100
mne-tools/mne-python#14426 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của mne-tools/mne-python
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
infrastructure qa
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
khuisman/mcp-gee-sweet#1068 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
The book has a Nix install section that chelis.ch lacks, and it names two of the three systemsĐang mởarea:ecosystem documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Chelis-Lang/chelis#3866 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`lvm_compact` has no self-hosted twin, and `docs/158` §5 says every language-face component mustĐang mởbug sev-3 vm
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
issue: Picking a prompt from the / menu in a channel inserts a command chip instead of the promptĐang mởbug confirmed issue
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 78/100
open-webui/open-webui#32712 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày