`plot_potential_merges` draws the correlograms of other units when a merge group is not sorted
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
widgets/potential_merges.pyから始めて、issueで選択順序とグループのドロップダウンの処理が指摘されている_update_plotを調べてください。plot_potential_mergesの既存テストを確認し、ソートされていないグループとハイフンを含むunit IDのテストを追加してください。各コレログラムが対応するunitのタイトルと一致し、結合されたIDがValueErrorなしで動作すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
I found this while reading widgets/potential_merges.py, not in my own analyses, so this is a "for the sake of improvement" report.
In _update_plot, the correlograms are selected with np.isin(unique_merge_units, plot_unit_ids), which follows the sorted order of unique_merge_units, while the titles follow the order of the merge group. For the group ["3", "1"], the autocorrelogram of unit 1 is drawn under the title of unit 3 and the reverse, without an error. Also, the group is rebuilt with split("-"), so unit ids containing "-", such as those made by merge_units(new_id_strategy="join"), raise a ValueError.
import matplotlib
matplotlib.use("module://ipympl.backend_nbagg")
import numpy as np
from spikeinterface.core import generate_ground_truth_recording, create_sorting_analyzer
from spikeinterface.widgets import plot_potential_merges
recording, sorting = generate_ground_truth_recording(durations=[20.0], num_channels=16, num_units=5, seed=0)
analyzer = create_sorting_analyzer(sorting, recording, sparse=False, format="memory")
analyzer.compute(["random_spikes", "templates", "spike_amplitudes", "correlograms"], progress_bar=False)
ccgs, _ = analyzer.get_extension("correlograms").get_data()
unit_ids = list(analyzer.unit_ids)
w = plot_potential_merges(analyzer, [["3", "1"]], backend="ipywidgets", display=False)
for k in range(2):
drawn = np.array([bar.get_height() for bar in w.axes_cc[k, k].patches])
match = [str(u) for i, u in enumerate(unit_ids) if np.array_equal(drawn, ccgs[i, i])]
print("panel", w.axes_cc[0, k].get_title(), "shows the autocorrelogram of unit", match)
# panel 3 shows the autocorrelogram of unit ['1'] expected ['3']
# panel 1 shows the autocorrelogram of unit ['3'] expected ['1']
merged = analyzer.merge_units([["0", "1"]], new_id_strategy="join")
plot_potential_merges(merged, [["0-1", "2"]], backend="ipywidgets", display=False)
# ValueError: '0' is not in list
Fix: select the correlograms with the index of each unit of the group, in the group order, and keep the groups themselves for the dropdown instead of joined strings.
I can open a PR with a test if you agree.
- 主要言語
- Python
- スター
- 883
- フォーク
- 291
- 平均マージ
- 3日 17時間
- マージ済み PR(30日)
- 40
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
SpikeInterface/spikeinterface のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
SpikeInterface/spikeinterface#5008 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
SpikeInterface/spikeinterface#5006 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
SpikeInterface/spikeinterface#5005 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
SpikeInterface/spikeinterface#5004 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
SpikeInterface/spikeinterface#5003 ·
メンテナーはふだん 2 日以内に返信
SpikeInterface/spikeinterface の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
available bug good first issue tooling
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
Nixitov/Riptide-Native#816 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
teng-lin/notebooklm-py#2593 ·
メンテナーはふだん 1 日以内に返信
-
claimed-by:collie role:small-fix status:running
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
Beovulfo/herd-sdlc#325 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 94/100
omarelshamy25x/shamy-arabic-nlp#267 ·
メンテナーはふだん 1 日以内に返信