`directional_derivative` ignores `channel_indices` in `get_traces`
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
preprocessing/directional_derivative.py から始め、DirectionalDerivativeRecordingSegment.get_traces が channel_indices をどのように使い、導関数を計算するかを追ってください。average_across_direction に関する #3631 のチャンネル選択の修正と比較し、チャンネルの順序が位置の順序と異なる場合に導関数がどう振る舞うかを確認してください。報告されたチャンネル選択と順序のケースについてテストを追加してください。完了の条件は、返される両方の形状が要求されたチャンネルに一致し、導関数の値が位置に従うことです。
索引モデルが issue の本文から書いたものです。
説明
I found this while reading preprocessing/directional_derivative.py, not in my own analyses, so this is a "for the sake of improvement" report.
DirectionalDerivativeRecordingSegment.get_traces reads all parent channels and returns the derivative of all of them, ignoring channel_indices. So get_traces(channel_ids=...), and recordings built on top of it such as select_channels, return all channels instead of the requested ones.
from spikeinterface.core import generate_recording
from spikeinterface.preprocessing import directional_derivative
recording = generate_recording(num_channels=16, durations=[1.0], seed=0)
derivative = directional_derivative(recording)
channel_ids = derivative.channel_ids[[0, 3]]
print(derivative.get_traces(channel_ids=channel_ids, end_frame=100).shape)
print(derivative.select_channels(channel_ids).get_traces(end_frame=100).shape)
# Output on current main:
# (100, 16)
# (100, 16)
# Expected: (100, 2) twice
Fix: return derivative_traces[:, channel_indices], as #3631 did for average_across_direction. Also, reading the code, np.gradient follows the channel order rather than the position, so a column whose channels are not sorted along direction gets wrong values.
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時間 初心者へのやさしさ 74/100
SpikeInterface/spikeinterface#5007 ·
メンテナーはふだん 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 日以内に返信
SpikeInterface/spikeinterface の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
daniel-ospina/tortoise#15308 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
difficulty:easy prio:low type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
NatronGitHub/Natron#2405 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Jstar269/nakagawa-recomp#3746 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信