Splitting _brain.py into multiple modules
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Python
- スター
- 3.5k
- フォーク
- 1.6k
- 平均マージ
- 1日 3時間
- マージ済み PR(30日)
- 74
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
mne-tools/mne-python のほかの issue
-
ENH: Add `description` filter parameter to `Raw.crop_by_annotations()`対応中かも @aman-coder03 が 192 日前に担当しました。 オープンENH
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
mne-tools/mne-python#13743 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
BUG
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
mne-tools/mne-python#14421 ·
メンテナーはふだん 1 日以内に返信
-
BUG
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
mne-tools/mne-python#14420 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
BUG: fNIRS `interpolate_bads` copies wrong channel when positions are missing対応中かも @kalomak が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 20/100
mne-tools/mne-python#14415 ·
メンテナーはふだん 1 日以内に返信
-
Add a check for `sklearn` availability to `decoding` module対応中かも @SohamXYZDev が 3 日前に担当しました。 オープン
難易度 3/5 半日 初心者へのやさしさ 35/100
mne-tools/mne-python#14394 · コメント 13 件 ·
メンテナーはふだん 1 日以内に返信
mne-tools/mne-python の issue をすべて見る
似ている issue
-
Questions crashes on a real SQuAD2 no-answer prediction対応中かも @HuaTNA が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
GST is read as Gulf Standard Time (UTC+4) instead of Guam Standard Time (UTC+10)対応中かも @yang00333 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
DOI-USGS/dataretrieval-python#454 ·
メンテナーはふだん 4 日以内に返信
-
area:core-platform effort:S priority:P3 status:in-review type:test
難易度 2/5 1時間未満 初心者へのやさしさ 80/100
randomparity/kdive#3246 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Requantification library converts m/z to mass with the hydrogen-atom mass instead of the proton massオープンbug
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
nf-core/metaboigniter#130 ·
メンテナーはふだん 1 日以内に返信
-
netbox status: needs owner type: documentation
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
netbox-community/netbox#23412 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信