Computing template metrics on an analyzer saved before 0.104.0 raises KeyError
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 62/100
Hướng nghiên cứu
Start by reading ComputeTemplateMetrics._handle_backward_compatibility_on_load and BaseMetricExtension._run, then trace how saved metric names and table columns are restored. Check the compatibility behavior for peak_to_valley, half_width, and peak_trough_ratio, including whether computed metrics are updated and users are warned when values need recomputing. Done means loading metrics saved by 0.103 and computing template metrics no longer raises a KeyError.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I came across this while looking at what happens to saved metric tables when a metric's columns change.
If an analyzer has template metrics saved by 0.103, computing any template metric on it with version >= 0.104.0 raises a KeyError.
The reason is that #4306 renamed or reworked some template metrics. On load, _handle_backward_compatibility_on_load updates the saved metric names, but not the saved metric table columns. When one then goes to compute more metrics, BaseMetricExtension._run copies the previously computed metrics into the new table column by column, using the columns each metric has now (not the saved ones that escaped renaming).
For example, 0.103 had a metric and column named peak_to_valley. The metric name is now mapped to peak_to_trough_duration, and this is the name used to look up the column on copy, but of course it isn't found. So it raises KeyError: 'peak_to_trough_duration'.
Other examples I found:
half_width: The metric name is stillhalf_width, but the expected columns aretrough_half_widthandpeak_half_width.peak_trough_ratio: The metric name is nowwaveform_ratiosand the expected columns arepeak_before_to_trough_ratio,peak_after_to_trough_ratio,peak_before_to_peak_after_ratio,main_peak_to_trough_ratio.
Here is what I would do, in ComputeTemplateMetrics._handle_backward_compatibility_on_load:
- Since
peak_to_valleyseems to have only changed its name and its old values equal the newpeak_to_trough_duration, rename its saved column topeak_to_trough_duration, matching the existing renaming of the metric. - Since
half_widthandpeak_trough_ratiochanged what they compute, their old values can't simply be relabeled, so drop their columns from the saved table, removehalf_widthandwaveform_ratiosfrom the computed metrics, and warn that they need recomputing.
I can open a PR for this.
- Ngôn ngữ chính
- Python
- Star
- 883
- Fork
- 291
- Merge trung bình
- 3 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 40
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 SpikeInterface/spikeinterface
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
SpikeInterface/spikeinterface#5008 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
`plot_potential_merges` draws the correlograms of other units when a merge group is not sortedĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
SpikeInterface/spikeinterface#5007 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
`plot_unit_presence` shows bin indices on the `Time (s)` axis when `time_range` is not givenĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
SpikeInterface/spikeinterface#5006 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
SpikeInterface/spikeinterface#5005 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
SpikeInterface/spikeinterface#5004 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của SpikeInterface/spikeinterface
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
available bug good first issue tooling
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Nixitov/Riptide-Native#816 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
teng-lin/notebooklm-py#2593 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
claimed-by:collie role:small-fix status:running
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Beovulfo/herd-sdlc#325 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 94/100
omarelshamy25x/shamy-arabic-nlp#267 ·
Maintainer thường phản hồi trong vòng 1 ngày