Repository navigation
[GUI] Match the extended property dialog and plotted component power - #986
Conversation
There was a problem hiding this comment.
If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.
Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.
|
Claude finished @arnodelorme's task in 1m 26s —— View job Code review
BlockingNone. ImportantNone. Nits
Test gapsNone. EEGLAB parity notes
|
| freqrange = numeric_vector(options.get("freqrange")) | ||
| bounds = freqrange if freqrange.size == 2 else (0, freqs[-1]) | ||
| low, high = (int(np.argmin(np.abs(freqs - limit))) for limit in bounds) | ||
| return freqs[: high + 1], spectra[0, : high + 1], (float(freqs[low]), float(freqs[high])) |
There was a problem hiding this comment.
Nit (reuse / visual parity): This adds a second freqrange-to-index lookup. eegprep.functions.sigprocfunc.spectopo.frequency_window already does it, and pop_prop._draw_spectrum (src/eegprep/functions/popfunc/pop_prop.py#L308-L312) uses it with spectra_ylim.
The data values match, but the y-axis does not. This code keeps bins 0 to low - 1 and sets no y-limits, so matplotlib autoscales over the 0 and 1 Hz bins, which sit outside the x-range. On the sample, IC2 at 0 Hz is 14.6 dB. spectopo sets the y-limits from the in-band data plus a 1/7 margin, so the EEGPrep dashboard spectrum ends up vertically compressed compared with EEGLAB's.
Suggested fix: Return min_idx/max_idx from frequency_window (or spectra_ylim's limits) in the dashboard data, and call set_ylim in _prop_browser._plot_spectrum the way pop_prop does. First check frequency_window's Nyquist validation against the [2 80] default when the sampling rate is under 160 Hz.
The property prompt now uses four native rows, with a fifth row for the classifier when present. A separate commit fixes the power spectrum in the resulting dashboard. The maximum measured vertical control error is 0.54 pixels on jamming. This PR stacks on #983.
On channel 1, IC 2 and IC 4, the largest normalized errors across the entire plotted spectra fell from 0.720, 1.073 and 0.987 to 2.64e-16, 2.94e-8 and 2.18e-8. All 46 frequency bins match. The dashboard now preserves epoch boundaries and applies the ICA scalp-map normalization used by spectopo.
Native captures and verification
The capture guard checked the EEGLAB and EEGPrep revisions and the imported Python package. The MATLAB R2025b measurements ran independently of the Python test runner. Focused tests on jamming reported 161 passed in 1.02s.
Dispatched the seven-shard real MATLAB reference suite for this branch. EEGLAB d0963be9d81acc5b66e84f8d3d7c89e3ce127cc4, eeglab_tests fec88f9ffe7c225eb1de8924db8b6a3e0d53a4d9. https://github.com/sccn/eegprep/actions/runs/46550808654
Fixes #960. Part of #875.
Full inventory report for the project team. pop_prop_extended (p. 98). PDF · Editable Word.