Repository navigation
Merge develop into the browser epic (land with a merge commit) - #629
Conversation
* Add a MATLAB replay for the latest fuzz repros. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Run the fuzz replay when the diagnostic branch is opened. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Match resample NaN support and stop false fuzz filings. A zero anti-aliasing tap no longer turns a finite resampled sample into NaN. Identical failure text is one error, and the yulewalk-not-found oracle report is not filed. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
…470) A two- or three-window calibration with reference selection off still returns cleaned data. A sampling rate whose default spectral breakpoints are not monotonic raises ASRCalibrationError from clean_asr, and clean_artifacts warns and leaves the recording unchanged. Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* Add full Riemannian ASR processing Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Add Manopt paths for Riemannian ASR MATLAB parity Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Allow the measured Riemannian ASR MATLAB residual Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Trace the Riemannian ASR MATLAB gap by stage Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Match MATLAB Weiszfeld weights and compare Riemannian ASR in double precision Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Tighten Riemannian ASR MATLAB parity to rtol 1e-8 Keep atol at 0 so the double-precision clean_asr comparison must match within 1e-8 relative error. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Report the worst Riemannian ASR sample on MATLAB mismatch Include the max relative gap, max absolute gap, and array index in the rtol=1e-8 failure so the MATLAB job identifies where the signals diverge. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* Add ds003061 stage comparisons against MATLAB. Cover the manuscript pipeline stages in the reference suite with isolated inputs, and keep the chained run optional. Treat an empty reject array as no component flags. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Keep ds003061 MATLAB comparisons on identical inputs. Send numeric tuples through as vectors, disable EEGLAB single precision for these calls, and store Picard activations as the unmixing matrix times the data. The reference workflow installs mind-inria/picard 617ce6a. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Return MATLAB comparison data in double and scale ICA to RMS. The options snapshot no longer asks MATLAB to return an if statement, and EEG.data is kept from before pop_saveset writes single. eeg_interp follows the input dtype, and Picard and runica match EEGLAB's RMS microvolt scaling. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Scale stored ICA activations instead of recomputing them. A second matrix product can change which tied sample has the largest magnitude, so component signs no longer match the posact rule. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Record the linux_x86_64_R2025b ds003061 chain summary. The values are the summary written by --record-parity-summary on MATLAB R2025b. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Match chain ICLabel rejections by mixing-column correlation. A matching count is not enough: rejected components must be the same ones after a one-to-one match that stays clear of the runner-up. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* Fix AMICA input serialization to match MATLAB frame order * Temporarily run the EEGLAB reference workflow and AMICA MATLAB comparison. workflow_dispatch cannot start a workflow that is not yet on the default branch, so a push trigger limited to this branch queues the run. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Run the AMICA MATLAB comparison without restarting the reference suite. Import the batch engine from the repo root and keep the reference workflow on workflow_dispatch so the in-progress suite is left running. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Remove the temporary MATLAB reference trigger. The EEGLAB reference run and the AMICA fwrite comparison were already queued from the earlier commits. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Rerun the killed EEGLAB reference core shard. The first core runner was shut down mid-suite and the Actions token cannot rerun that job. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Unblock the core reference rerun from the stuck suite. The first run is still marked in progress after its runner shut down, so a new concurrency group lets the core shard start. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Remove the temporary core-shard rerun. The follow-up runner was shut down at the same test as the first attempt. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* Match minphase FFT NaN blocks and single-precision average reference. Overlap-add filtering follows MATLAB fftfilt, so a NaN stays in one FFT block. Fuzz average reference keeps float32 sample values. One ASR calibration window is the same failure on both sides. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Compare fuzz average reference in float64. The float32 product moves between BLAS kernels, so the survey keeps the double-precision product and turns EEGLAB option_single off. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Restore EEGLAB options bytes and name the ASR window count. pop_editoptions rewrites eeg_options.m, so the fuzz session snapshots that file and writes the same bytes back. Fewer than two calibration windows reports the window count instead of a length bound the recording already meets. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Sort the options-file import and fail a missing snapshot. The ds003061 tests import the snapshot helper with the other tests imports. The replay fails when eeglab_options did not load a file to restore. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* Ungate Python-only reref and HDF5 loader tests. These cases never call MATLAB, so the class and module skip gates kept them out of fast CI. Parity tests stay skipped without MATLAB. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Replace np.fix with np.trunc in yulewalk and findboundaries. Both round toward zero, and the int() results match on the values these call sites pass. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Import Traversable from importlib.resources.abc. importlib.abc.Traversable is removed in Python 3.14. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
The MATLAB parity test kept only mu. Check sigma, alpha, and beta with the same assert_almost_equal tolerance. Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
…479) * Control sample Picard parity for double precision and identity init Require mind-inria picard_python_port and turn option_single off, restoring the EEGLAB options file afterward. Report Amari and matched correlation. Leave the 0.65 floor unchanged. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Reload option_single and find the PICARD plugin folder pop_editoptions writes the options file without updating the workspace variable. Match plugins/PICARD case-insensitively so a standalone MATLAB session can see eeg_picard. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Assert sample Picard parity with Amari and matched correlation Replace the 0.65 weight-correlation floor with Amari distance <= 1e-5 and minimum matched mixing-column correlation >= 0.9999. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Look up the PICARD plugin by name and drop dead sample-test output Check plugins/PICARD and plugins/picard directly, and remove the unused Picard plot and sample_data weight file. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Stop writing Picard sample sets and drop the unused results dict Nothing reads the saved Picard datasets, and the shape checks no longer go through the old three-engine results map. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* Store BIDS event durations as duration times the sampling rate Keep zero, fractional, and missing durations instead of rounding them up to one sample, and compare the ds003061 import with MATLAB. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Treat matching NaN event durations as equal in ds003061 parity Missing BIDS durations stay NaN, so the event check must not use a difference that is false for NaN. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* Compare legacy eegfilt to EEGLAB eegfilt on sample recordings. Record that the MATLAB filtfilt pad length leaves longer segments unchanged and is what admits EEGLAB's shortest epochs. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Allow a 1e-12 absolute floor on eegfilt coefficient parity. Report interior error as n/a when the filtfilt pad covers the epoch. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* Match MATLAB's absolute pinv cutoff in ASR reconstruction. NumPy's 1e-15 relative cutoff inverted numerical null directions in rank-deficient ASR matrices and amplified signals by about 1e13. Use max(size)*eps(norm) and treat an explicit tol as an absolute cutoff. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Give the ill-conditioned pinv check an absolute cutoff bound. rtol 0.53 alone rejects MATLAB when a small entry moves by the SVD sensitivity of the singular value just above max(size)*eps(norm). Allow that absolute gap, rtol/sigma_min, and still fail a 1e13 inversion. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Share MATLAB's pinv cutoff and check stable residuals. np.linalg.pinv now uses one helper for max(size)*eps(norm). Ill-conditioned parity compares Penrose products and the ASR projector instead of raw entries. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Compute the MATLAB pinv cutoff from one SVD. ASR and spherical splines call pinv(). Non-finite input returns all NaN, and the ASR parity check includes a partial keep mask. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Share the masked-null ASR test setup. Name the rank-disagreement gap and drop the stale spline shape comment. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Name the ASR reconstruction rank thresholds. Reuse the dropped-null gap and bound the reconstruction norm. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Move the dropped-null gap constant into test fixtures. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* Route BIDS BrainVision import through pop_loadbv BIDS .vhdr files were loaded with NEO, which drops channel references and rejects vectorized recordings on older NEO. Read them with pop_loadbv and apply a sidecar EEGReference as the dataset reference. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Compare binary readers with EEGLAB on suite recordings Add MATLAB reference tests for CNT, EGI, BrainVision, BDF, and ERPSS files in the pinned eeglab_tests suite. Default CI leaves them deselected. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Match EEGLAB binary readers on the suite recordings Compare BrainVision samples in MATLAB's dtype. Return empty EGI event arrays as 0-by-0, import continuous-series events with pop_chanevent, and drop the BioSemi Status channel after reading its trigger edges. Keep the BIDS dataset reference at common and store EEGReference in etc.BIDS. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Honor BIOSIG event options and share the EGI pop_chanevent path Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Document BIOSIG import differences and correct EGI epoc handling Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Split EGI epoc trials only when pauses land on the boundaries Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Clarify that EGI epoc pauses become the trial boundaries Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* Keep k-means cluster numbers in initial-centroid order Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Match EEGLAB kmeans_st and command-line kmeanscluster Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Correct STUDY k-means migration notes Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Drop pop_clust.m line numbers from the migration note Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* Preserve epoch events and subject in MNE conversion Build EEG.event and EEG.epoch from time-locking events and other events inside each epoch window, and copy subject through MNE subject_info on the round trip. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Keep MNE epoch events consistent with the urevent table Drop event.urevent when the urevent table is empty, preserve annotation durations in samples, and keep numeric event types when every type is numeric. Epoch windows are half-open so a boundary event belongs to one epoch. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Keep padded event types and consistent durations Convert an event type to int only when str(int(text)) matches the text, so '001' stays '001'. Give every event a duration when any duration is nonzero, and raise a clear error when an epoch has no events. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Reject an empty epoch before the MNE reader eeg_eeg2mne raises ValueError when an epoch has no events, before read_epochs_eeglab indexes that epoch. Document the float lossless rule and the ValueError. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* Match pop_select event cleanup to EEGLAB eventconsistency pop_select now ends in eeg_checkset(..., 'eventconsistency'). Duplicate boundary durations accumulate forward, and the final-boundary cutoff uses MATLAB rounding. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Record EEGLAB event-sort and numeric-boundary differences Synthetic epoched sets save an empty epoch array so MATLAB batch runs do not open errordlg2. Event consistency still sorts by epoch then latency and merges numeric boundary runs. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Put sort-fixture latencies inside their epochs Drop the eventconsistency comments that repeat the migration notes, and keep the numbered cleanup steps. Epoched sort examples use absolute latencies that fall in each event's epoch. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* Match MATLAB colon starts for fractional clean_rawdata windows np.arange was keeping one extra trailing window when the overlap step is not an integer. clean_windows also leaves window_len*srate unrounded, so 0:N-1 indexes floor(N) samples. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Drop the duplicated colon oracle from window-start tests The Python sweep compared matlab_colon to a copy of itself. Known MATLAB vectors stay as regressions; the MATLAB length sweep remains the oracle. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* Export public statistics and signal helpers from eegprep The ported EEGLAB tests resolve these names on the package, and the statistics helpers were only available from their subpackage. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Run the ported EEGLAB tests on the Python backend with strict xfails Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Name Python-lane xfails by cause and unpack fdr results Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Match Python-lane subtests with public pytest reports Use isinstance against the reported exception, unpack only results that declare matlab_outputs, and deselect MATLAB-oracle classes by marker. The workflow no longer claims it can mark the job required. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Keep the Python-lane parent report passed in makereport The status hook only returns the passed category. It no longer rewrites report.outcome after the subtests plugin builds the synthetic parent failure. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Expect AttributeError from selectevent eventconsistency xfails eeg_checkset now calls event.get on MATLAB struct arrays, so these strict xfails no longer fail as TypeError. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Record passed parents without rewriting an already-passed report The tryfirst status hook runs before the subtests plugin and returns the passed category. The makereport hook only records that parent. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* Keep short EEG imports channel-major Pass the channel count already known to the BIOSIG, File-IO, ERPSS, and SnapMaster readers so a window with fewer samples than channels is not rejected by the orientation guard. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Compare short EDF and GDF windows and the jo1_3 trigger The [0, 1] window has no events, so require trigger 34 at sample 96 on [3, 4]. EEGLAB can import the 128-sample EDF and GDF recordings; the 8-sample fixtures stay Python-only because biosig2eeglab indexes 100 samples. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Compare short EDF and GDF windows to EEGLAB single precision EEGLAB returns float32 for both formats and matches the Python samples after they are cast to float32. biosig2eeglab line 198 indexes 100 samples only for non-BDF files whose header has no events. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
…492) * Read BIDS EDF and BDF with pop_biosig and decode non-UTF-8 sidecars. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Resolve BIDS sidecar metadata without patching pybids. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Order same-directory BIDS sidecars by entity count. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* Add NumPy erpimage engine matching EEGLAB on MATLAB R2025b The engine ports erpimage.m numerics (sorting, movav smoothing and decimation, phasecoher amplitude/ITC with bootstrap, ERP and axis limits) using only NumPy. A committed 165 KB fixture holds R2025b outputs for 42 scenarios; the engine matches them at rtol 1e-12 and a MATLAB-marked class regenerates it live. Tested: tests/test_erpimage_engine.py (164 passed; 42 live parity passed). * Replace erpimage with an EEGLAB-faithful port erpimage now takes EEGLAB's positional arguments and options (tokens or keywords), returns the fifteen EEGLAB outputs plus the figure, and draws EEGLAB's layout from the NumPy engine. Documented deviations: sortidx indexes input trials, 'noplot' hides only the sortvar trace, 'erpalpha' uses unbiased signs (sccn/eeglab#976). pop_prop passes EEGLAB's pop_prop arguments; the pop_erpimage call site is adapted minimally until its full port. eegprep.erpimage is exported, so the pinned EEGLAB erpimage contracts now pass on the Python backend. Tested: erpimage, engine, pop_prop, plot wrapper and console tests. * Document the faithful erpimage port and its EEGLAB differences Adds an ERP images section (signature, outputs, engine, MATLAB R2025b parity) with the documented-vs-actual differences, including the unbiased erpalpha signs (sccn/eeglab#976), a changelog entry, and the parity-matrix row. * Speed up erpimage smoothing and wavelet sorting without changing results Boxcar smoothing uses van Herk/Gil-Werman sliding sums (same terms, different order: within 2*width*eps*max|x|) and the phasecoher projection uses FFT correlation with the demeaned kernel on mean-removed trials. The 42 MATLAB R2025b scenarios still match at rtol 1e-12, live and from the fixture. 2000x2000: boxcar width 200 1.20 s -> 0.05 s; phase sort at 4 Hz 10.1 s -> 0.26 s. * Test the remaining erpimage engine input forms and checks Covers concatenated input, weighted windows wider than their weights, topphase and amplitude-sort validation, plotamps color limits and timewarp line styles. Tested: tests/test_erpimage_engine.py (167 passed). * Follow the comment policy in the erpimage port Drops comments that excused a temporary gap or a warning suppression (the Accelerate matmul flags are no longer silenced, as elsewhere in EEGPrep), and checks outtrials against EEGLAB's repeated addition instead of a tolerance. Tested: erpimage, engine and plot-wrapper tests. * Image erpimage plotamps at the sorting frequency With 'phasesort' or 'ampsort', erpimage.m replaces the 'coher' frequency by the sorting frequency before computing the 'plotamps' image; the engine only reported it in limits. Adds MATLAB scenarios with a differing 'coher' frequency, a phase-sorting band, amplitude sorting and amplitude rejection with large decimation, and records the compute-only calls with the documented 'NoShow' switch. Tested: fixture parity (46 scenarios) and the erpimage test files. * Validate erpimage option values by name Each option has its own parser that checks size, type and range and raises ValueError naming the option, instead of taking the first element or failing later with a NumPy error: erp=2.5, two-element srate, NoShow=0, cycles=0, reversed or negative caxis, unknown plotmode, sortvarpercent outside 0..1, baseline without two finite values and non-finite coher now raise. A boolean after a flag token is its value, an auxvar list is (matrix, colors) only when its second item names line styles, and the 'allcohers' message says erpimage.m marks it UNIMPLEMENTED. Tested: erpimage engine, plot and pop wrapper tests. * Validate erpimage data and log the notes EEGLAB prints The engine now raises ValueError where it used to reshape or compute a wrong image: data whose trial count does not match sortvar (only a single row or column is read as concatenated trials), a 2-D sortvar, Inf data, all or all but one NaN sortvar, non-scalar or non-finite avewidth and decimate, decimate below minus the trial count, times that are not finite and increasing, phase or amplitude sorting above Nyquist, limits or baseline windows without samples, renorm 'yes' on a constant sortvar, amplitude rejection leaving fewer than two trials, timewarp events with the wrong row count or outside the epoch, and zero wavelet amplitudes for 'plotamps' or 'coher'. rng also accepts an integer seed. What EEGLAB prints and continues past (replaced NaN data, removed NaN-sortvar trials, clamped avewidth and decimate, retained epochs, large alignment shifts, clipped limits, Nyquist-reduced bands and ignored or overridden options) goes to the module logger; the engine imports only NumPy and the standard library, now including logging. Tested: erpimage engine, plot and pop wrapper tests. * Compute erpimage limits and permutations without spurious warnings A zero ERP, amplitude or coherence peak now returns EEGLAB's result directly (NaN ERP and coherence limits, amplitude limits of 0) instead of running the rounding loop until its factor overflows under a hidden errstate. The erpalpha permutation projection uses np.dot, which avoids the divide, overflow and invalid-value warnings macOS Accelerate emits from matmul on finite data, with the same speed. Drops the unused issue-URL constant and comments that restated code or justified tolerances. Tested: erpimage engine, plot and pop_prop tests with RuntimeWarnings as errors. * Check erpimage targets and insets before drawing target must be a Matplotlib Figure or SubFigure (TypeError otherwise) and cannot be combined with NoShow; a figure erpimage creates is closed when drawing fails. A scalp-map channel outside the channel locations, a map of the wrong length, or a spectrum band above Nyquist raise before any figure exists, and the unused third 'topo' element and out-of-range 'img_trialax_ticks' are logged. The scalp-map inset takes its aspect from the target SubFigure instead of the root figure, and a log spectrum axis starts at the first analyzed frequency instead of 0 Hz. Tested: erpimage plot, engine and pop wrapper tests. * Point pop_erpimage to erpimage for options it does not expose Phase sorting, coherence, the spectrum inset, amplitude images, event alignment and renorm formulas are supported by erpimage, so pop_erpimage's errors for them now say the dialog does not expose them and to call erpimage directly, instead of claiming EEGPrep lacks them. pop_prop raises ValueError for all-NaN activity before creating its figure, and its comment states that the 10000 ms sorting value is past the end of epochs shorter than 10 s. Tested: pop_erpimage, pop_prop and erpimage plot tests. * Replace coverage-padding erpimage tests with behavioral checks Option-branch and helper tests that only checked flags and shapes become assertions on what users see: image rows bottom to top in sorted order and the sortvar trace on the trial positions, the erpalpha band on constant data and the permutation count, decimate clamping, the srate option, rounded timewarp reference frames, per-trial vertical lines following the sort, both caxis forms, baseline windows past the epoch and the first-quarter fallback, renorm operators, Butterworth pass and stop bands, rng through erpimage, the coherence significance band, the spectrum inset in dB, colorbar ticks, pop_erpimage's microvolt label, pop_prop's smoothing thresholds and literal ERP ticks, and the sorting frequency used by 'plotamps'. The engine's private nan_mean, gauss, baseline and timewarp helpers are pinned to the package versions; the import-isolation test reports stderr and exercises more paths; the sample-data cache no longer depends on which fixture loaded it; legacy reference failures check EEGPrep's error type and message; the lazy-export test checks the module loads on first use. Tested: erpimage engine, plot, pop_prop and pop wrapper tests; 30 targeted mutants are killed. * Document erpimage validation, logging and pop_erpimage changes The changelog lists the pop_erpimage image-shape changes from EEGLAB's smoothing and decimation (measured on the sample epochs), the dropped missing-value epochs, the component ERP label and the new errors, and the erpimage page lists which inputs raise, which EEGLAB notes are logged, the decimate bound, the standard-library imports and the parity tolerance as within 1e-12 of each output's largest magnitude over 46 MATLAB scenarios. The pop_erpimage help, the preprocessing guide and the parity matrix no longer say phase sorting, coherence or alignment are missing from EEGPrep, and the help no longer claims 'noplot' changes history replay. Tested: Sphinx HTML build without the gallery, help-resource tests. * Test pop_erpimage's pointers to erpimage and its vertical marks Covers the reworded errors for phase sorting, coherence and amplitude images chosen in the dialog and for renorm formulas, and the dashed line drawn for a requested 'vert' latency. Tested: pop_erpimage tests.
) * Expose erpimage option items in the order they apply erpimage_option_items returns EEGLAB tokens and keywords as (name, value) pairs with canonical names, which parse_erpimage_options now applies, so callers such as pop_erpimage can merge their defaults with the user's options and write them back as keywords. Keyword options also accept EEGLAB's aliases (colorbar, phase). Tested: erpimage engine and plot tests. * Show array shapes in ErpimageResult's repr Consoles echo a result such as pop_erpimage's as one readable line with the shape of each output instead of every array value. Tested: erpimage plot tests. * Add event-list and mirrored-edit callbacks to Qt dialogs select_event_field opens EEGLAB's listdlg2 of event fields, select_event_types can pick several types in a pop_chansel list, both warn when the companion box is still empty, and mirror_text copies an edit into another when both are filled, as pop_erpimage.m does for its phase and coherence frequencies. Single-type selection is unchanged. Tested: GUI primitive tests offscreen. * Port pop_erpimage and its dialog to EEGLAB's pop_erpimage.m pop_erpimage takes EEGLAB's arguments (typeplot, channel, projchan, titleplot, smooth, decimate, sortingtype, sortingwin, sortingeventfield) followed by any erpimage option as tokens or keywords, and returns the erpimage result (with the history command when return_com=True). Channels are given by number or label and averaged; components are imaged directly or back-projected (several projection channels averaged, an EEGPrep extension). Trials are sorted with eeg_getepochevent, and events without the field, with no match or with unusable values raise distinct errors while epochs left out are logged. nosort and noplot reach erpimage, limits set the axes instead of cropping, smoothing and decimation are validated by erpimage instead of being truncated, defaults follow EEGLAB (smooth 5, decimate 0, label or 'Comp. N' titles) with the ERP trace, colorbar and scalp map on. The dialog restores EEGLAB's component scalp-map checkbox and map, event-field and event-type list buttons, mirrored phase and coherence frequencies and the full result mapping (limits(1:9), phase, coherence, yerplabel, flags, More options). Tested: pop_erpimage, dialog (renderer seam and offscreen Qt), plot wrapper, reference workflow (Python backend) and console tests. * Compare pop_erpimage with MATLAB on the sample epochs Five command-line pop_erpimage calls (channel sorted by rt latency, channel label with position values rescaled, two channels with a sorting window and nosort, a component, and a projected component aligned on the median) are recorded with MATLAB R2025b and EEGLAB 8ac485f6 without running eeglab.m, and compared within 1e-10 of the data scale: sortvar order, outvar, outtrials, image row sums and frames, and the ERP. The fixture is 16 KB, so the committed erpimage fixtures stay under 200 KB; the live class regenerates it through MATLAB. Tested: fixture parity and live parity on R2025b. * Test pop_erpimage across the GUI and eegprep-console A console call records its history without storing a dataset and returns a compact result; a dialog run from the Plot menu records a Python command that the console sees as LASTCOM and can edit and run again, both landing in the shared ALLCOM. Tested: console workspace tests. * Document the pop_erpimage port and its dialog The pop_erpimage help, the GUI tutorial (with the menu-to-console workflow and what stays synchronized), the preprocessing guide and the pop API page describe EEGLAB's argument order, the default decorations, event sorting and the dialog; the changelog lists the API changes and the parity matrix row records the port and its tests. Tested: Sphinx HTML build without the gallery and the help-resource tests. * Test pop_erpimage's mean component map and history edge cases Pins the mean map of several projected components in the scalp inset, the missing inset for several channels, empty smoothing arguments in the history command and the dialog ignoring Rescale without a sorting field; these were the survivors of a mutation run over the port (49 mutants, all killed now). Tested: pop_erpimage and dialog tests. * Keep Qt dialog tests from blocking and catch slot exceptions pytest-timeout now stops any test after 300 s with the thread method, which also interrupts a test blocked in Qt's event loop by a modal dialog. A shared qt_dialogs fixture answers message boxes, item and text prompts and list dialogs (cancelled unless a test sets an answer) and fails the test on exceptions raised inside Qt slots, which Qt only prints. The GUI primitive and pop_erpimage dialog tests use it. Tested: every test file that builds a Qt dialog, offscreen. * Match numeric event types by value in eeg_getepochevent Event types stored as numbers (2.0 after loading a .set file, int or uint16) now match typed or numeric requests by value, as EEGLAB's str2num comparison does, so '2', '2.0' and 2 all select type 2; text types still match exactly. An event whose epoch is missing, NaN, fractional or outside the trials is named in the error instead of failing with a conversion error. Tested: event function tests. * Parse pop_erpimage channels, event types and dialog numbers like EEGLAB Channels, components and projection channels accept MATLAB ranges and brackets ('3:5', '[3 4]'), quoted label lists and labels in any case (through eeg_decodechan); projection channels are validated like channels and ignored for channel plots, as EEGLAB documents. Event types keep quoted types with spaces from the dialog, a string sortingtype is one type, and numeric types are listed and matched by value. Dialog numbers go through numeric_vector, so ranges such as 0:250:500 work, and a blank Channel, Smoothing or Downsampling raises instead of becoming 1 or 0; the parallel number and token parsers are removed. Tested: pop_erpimage, dialog, console and reference workflow tests. * Check pop_erpimage inputs before drawing The plot flag is validated and the history command built before erpimage draws, so a bad value no longer leaves a figure open; a scalp map given with a copy of the dataset's channel locations is recognized by its labels. Components need 2-D icaweights and icasphere (None no longer passes), sorting by events on epoched data needs epoch numbers in the events, and the scalp map is left out with a warning when the plotted channel has no finite location. The unused _plain helper is gone. Tested: pop_erpimage and dialog tests. * Keep pop_erpimage's option order and report what it ignores Options keep the order of their last occurrence after the default decorations, so 'coher', ..., 'erp', 'off' leaves the ERP off as in EEGLAB. Event types or a window without a sorting field, epochs left out for lack of an event value (counted from 1) and the scalp map left out for several channels are logged as warnings. An empty channel opens the dialog like EEGLAB's isempty check, More options errors keep the parser's reason, the colorbar tooltip reuses the color-limit help as EEGLAB does, and the dialog lists the reminder-text deviation. Comments that restated code or justified choices are removed. Tested: pop_erpimage, dialog, console and reference workflow tests. * Open the event-type list without preselecting typed types EEGLAB's pop_erpimage passes no preselection to pop_chansel and the selection replaces the box text; an unknown typed type no longer breaks the list. Adds Qt tests for the phase mirror, cancelled type and field pickers, and the reminders. Tested with the GUI test files. * Fill the pop_erpimage dialog from the call and the last command Explicit arguments and options now seed the dialog fields the way pop_erpimage.m restores them (More options holds the rest), and the dialog's values replace them; options no field can show are applied as given. A new lastcom keyword restores an earlier history command, and the Plot menu passes the last matching ALLCOM entry as EEGLAB's menu does. smooth and decimate default to None so the dialog keeps its own defaults. Tested with the pop_erpimage GUI, pop and console tests. * Test pop_erpimage boundaries, event edge cases, titles and replays Adds the last channel and component boundaries, sorting fields carried by some events only, the latency-only warning, the missing-event message, default titles for several items, the scalp-map marker position, a full zero-smoothing comparison and a coherence replay that checks real values. create_erpimage_epochs now accepts any trial count, and the fixture-size test checks the erpimage fixtures that exist. Tested with tests/test_pop_erpimage.py. * Test pop_erpimage dialog options in the figure and real Qt widgets Covers caxis, vert and spec reaching the figure, Image amps with a coherence frequency, the smoothing default below six trials, the size checks of every numeric field, bracketed and quoted entries, and a round trip through the real Qt widgets. The spec test keeps only the tag order and states. Tested with tests/test_gui_pop_erpimage.py. * Test pop_erpimage console and menu synchronization Adds GUI listener notification for console calls, the menu's console echo and GUI refresh, the component menu history and a cancelled menu dialog. The console tests now draw on Agg, and a repr check that duplicated an erpimage test is gone. Tested with tests/test_console_workspace.py. * Check frame-weighted image and ERP sums against MATLAB The pop_erpimage fixture now stores frame-weighted row sums of the image and a weighted ERP sum, so a reordering of frames that keeps row sums is caught. Regenerated with MATLAB R2025b from the pinned EEGLAB functions; the erpimage fixtures total 198,735 bytes. Tested with the fixture parity tests. * Document pop_erpimage's dialog restore, event types and limits The help, tutorial, changelog and API page now cover the restored dialog and lastcom, the dialog winning over arguments with More options on top, quoted and numeric event types, the limits array, zero smoothing, the rng history rule, the scalp map left out for several channels, and that EEGLAB tokens follow all ten positional arguments. The changelog no longer claims every missing match raises; the pipeline page gets back its Plot menu sentence, and the parity row lists the remaining differences. Tested with the help and parity-matrix tests. * Test unusable channel items, unlocated ICA channels and array epochs Covers a channel entry that is neither number nor label, the component scalp map left out when the ICA channels have no locations, an erp value the checkbox cannot show going to More options, text that cannot match numeric event types, and epoch numbers stored as arrays. Tested with the pop_erpimage, dialog and event test files. * Record every integer rng seed in pop_erpimage history A boolean seed is an integer to NumPy's default_rng, so writing it as one keeps the replay identical; the special case is gone. Tested with tests/test_pop_erpimage.py. * Test pop_erpimage paths that mutation testing left open Adds typeplot=True, renorm case and blank handling, the significance level size, the no-event list messages, the component dialog build, the amplitude image and ERP deviation reaching erpimage, bracketed quoted labels, a padded sorting field and dialog limits replacing hidden caller limits. Tested with the pop_erpimage and dialog test files. * Raise when only some events carry an epoch in eeg_getepochevent An event without an epoch field was placed in epoch 1 and overwrote that epoch's value. Epoch 1 is now the default only when no event has the field (continuous data); otherwise the event is named in a ValueError. Documents value matching for numeric types and exports event_type_text, with tests for fractional, zero and text types. Tested with tests/test_core_event_eeglab_tests.py and tests/test_pop_erpimage.py. * Follow MATLAB for a:b ranges and read empty quoted tokens A two-part colon range now counts up by one as in MATLAB, so 5:3 is empty instead of 5, 4, 3 (an explicit negative step still counts down), and parse_text_tokens returns '' for an empty quoted token instead of raising StopIteration. Tested with tests/test_pop_utils.py and the full non-slow suite. * Write NumPy scalars and dicts as plain literals in history python_literal now converts every NumPy scalar with item(), so NumPy 2 values such as np.str_('rt') no longer leak their repr into history commands, and writes dicts entry by entry so channel locations replay without NumPy. Tested with tests/test_phase4_plot_wrappers.py and the full non-slow suite. * Open pop_erpimage's channel lists without a preselection The channel and projection-channel buttons passed the typed text to pop_chansel as a preselection, so ranges, bracketed lists or unknown labels raised inside the Qt slot. EEGLAB's commandchan passes none; a preselect flag on the shared callback now turns it off for this dialog. The qt_dialogs stand-ins record their keyword arguments, and tests check the listed fields and types, both channel buttons and OK without a choice. Tested with the dialog and GUI primitive tests. * Let the dialog's fields replace More options, as pop_erpimage.m does EEGLAB reads More options first and then sets each filled dialog field, so the fields win; an empty field or unchecked box leaves a More options value in place, and the ERP axis label is always the dialog's. The reverse order was an unrequested deviation. Options the dialog always sets (erp, cbar, yerplabel) are no longer moved into More options when the dialog is filled from a call. Tested with the dialog, pop and console tests. * Build pop_erpimage's default titles as EEGLAB does pop_erpimage.m concatenates several channel labels without a separator, prints component numbers with int2str (two spaces between columns), and writes projection channels as vararg2str does, with double quotes around labels; without channel locations a channel title is int2str of the numbers. EEGPrep now builds the same titles. Tested with the pop, dialog and console tests. * Reject misplaced options and malformed types in pop_erpimage A lowercase erpimage option given as projchan or titleplot, or a title that is not text, now raises with a hint that EEGLAB-style tokens follow all ten positional arguments (pop_erpimage(EEG, 1, 14, 'phasesort', ...) silently drew a plain image). plotmap takes 'on'/'off' and 1/0 like the other flags, the plot flag is checked by plot_enabled instead of a side-effect call, empty or unclosed quoted event types in the dialog raise, and a type list mixing numbers and text shows integer numbers without '.0'. Tested with the pop, dialog, console and plot wrapper tests. * Keep pop_erpimage's scalp-map and epoch messages accurate and short A caller's topo no longer triggers the 'left out' warning for several channels, a dataset whose channels have no locations says so instead of dropping the map silently, and epoch lists in warnings and errors stop after ten numbers. Tested with the pop, dialog and console tests. * Restore the seed and dataset locations from pop_erpimage's lastcom lastcom now restores an integer rng and reads EEG['chanlocs'] inside a topo tuple as the current dataset's locations, so the commands pop_erpimage writes replay through the menu and lastcom unchanged; no other expression is evaluated. Parse failures, including deep nesting, raise ValueError, and **kwargs gets a clear log line. History names EEG['chanlocs'] only when labels and positions match, keeps a chaninfo element, and otherwise writes the locations in full. Tested with the pop, dialog and console tests. * Fail tests that open unanswered modal Qt dialogs instead of hanging An autouse fixture makes QDialog.exec and the QMessageBox statics raise unless a test answers them through qt_dialogs or carries the new modal_dialogs marker (two pop_studydesign tests drive real dialogs), so a regression fails one test at once rather than stopping the whole run after the 300 s thread timeout. The engine's 30 s timeout uses the signal method again, and the pyproject comment says the limit is repository-wide. Tested with the full non-slow suite and the GUI and engine test files including slow tests. * Share pop_erpimage test helpers and close remaining test gaps The sample-epochs fixture and figure cleanup move to conftest, the 'dialog accepted as it opens' values to tests/fixtures.py, and the console tests use one inputgui stand-in and close figures even when a test fails. Only tests that build real Qt widgets carry the gui marker. New and stronger tests cover the menu picking the matching typeplot's command, ICA checks for weights and sphere separately, a PCA-reduced component bound, the amplitude image against a direct erpimage call, a warning for sortingwin alone, no warning for one latency per epoch, a blank sortingwin, an np.int64 seed and seeded types with commas or apostrophes. Tested with the full non-slow suite. * Document pop_erpimage's dialog fields, differences and lastcom limits The help now lists every dialog field with the argument or option it sets, explains smoothing and decimation, the sorting window unit, several matching events, 0-based urevent values and the EEGLAB-style precedence of filled fields over More options, and gathers the remaining differences from EEGLAB, which the dialog spec and the parity row (now 1_long_tail_helper_coverage) list too. The docstring documents every parameter and the errors, the changelog and tutorial use standalone wording and semantic line breaks in new prose, restore the still-true notes dropped from the earlier entry, and the pipeline example says it needs epoched data. Tested with the help, parity-matrix and pop_erpimage tests. * Draw component scalp maps from the channels that have a location A component ERP image on a dataset where some channel has no theta made topoplot fail; the mean component map now keeps only the located channels, as EEGLAB's topoplot does. Found by rerunning the review probes. Tested with tests/test_pop_erpimage.py. * Test pop_erpimage paths left open by the second mutation run Adds 1-D ICA weights, the component dialog's labels, call values no dialog field can show (text smoothing, a numeric renorm, a boolean caxis, a 2-D vert), lastcom details (a padded command, an unread positional argument, a float() call, tuples, a function that only contains the name), a partly missing epoch field, numeric types in the missing-event message, history order for a repeated option and a whitespace-only field before the reminder. Tested with the pop and dialog tests. * Size pop_erpimage's dialog columns as EEGLAB's supergui does The Qt renderer sized row controls by their content, so the Epoch-sorting field and Event type(s) buttons were narrower than the fields under them, the labels beside them drifted left, and fields touched the checkboxes next to them. A new opt-in DialogSpec flag, weighted_columns, gives each control its geometry weight's share of the row minus supergui's spacing, with column_spacing as the pixel gap; pop_erpimage uses it with supergui's 27 px gap and 37 px margins at 1113 px. Other dialogs are unchanged (pop_envtopo, pop_adjustevents and pop_newtimef captures are pixel-identical). Tested with the dialog, GUI primitive and visual parity tests. * Use the standard dialog font and EEGLAB's height for pop_erpimage The dialog's 11 px font and 15 px controls made its text about two thirds of EEGLAB's relative to the dialog width; with the renderer's standard 16 px font, labels take the same share of their columns as in EEGLAB's dialog. The height now follows EEGLAB's window: 834 px for channels and 870 px for components, which have one more row. Tested with the dialog and visual parity tests. * Use the repository timeout method for the engine hang test The signal method needs SIGALRM, which Windows lacks, so pytest-timeout aborted the whole Windows run with an INTERNALERROR. The test now takes the repository-wide thread method, as on develop. Tested: the test passes locally and the Windows job is the check.
* Accept EEGLAB name/value calls in statcond Translate MATLAB option pairs with parse_key_value_args and return MATLAB-shaped outputs, including seeded resampling cells. Clear the STATCOND Python-backend xfails that now pass. Parametric cases 1-30 remain expected failures against the stored zero tolerances. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Match EEGLAB's Welch default for unpaired statcond. statcond finputcheck uses inhomogenous variance. ttest2_cell keeps its own equal-variance default. The remaining zero-tolerance cases stay expected failures, with the single-precision ANOVA reason spelled out. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Compare unpaired statcond defaults with EEGLAB on seeded data. Drop the fitted Welch fixture. A MATLAB engine test calls statcond on a seeded 3 by 12 versus 3 by 9 sample, and a Python test checks that the default matches explicit inhomogenous variance. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Derive Python tolerances for the double statcond t-tests. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Derive the Welch statcond tolerance and keep the p bound finite. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* Port missing EEGLAB history and help helpers Add eeg_hist, is_sccn, iseeglabdeployed, eeg_helphelp, helpforexe, and disp, and return gethelpvar descriptions as 1-by-N rows so the Python backend xfails for those checks can pass. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Record eegh replays once and harden history helpers Strip hostname output instead of dropping a character, time out the hostname command, join history rows before appending, and execute only session history entries. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* Use 1-based indices for EEGLAB numerical helpers. abspeak, matcorr, matperm, hungarian, getchanlist, shuffle, and eeg_amplitudearea now match EEGLAB's 1-based index and dimension contract. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Keep the getchanlist reference test attached to its EEGLAB decorator. The first-and-last channel check is a separate Python test. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Return 1-based row indices from mapcorr. mapcorr now matches EEGLAB row numbers. The hungarian shape gap stays an xfail attributed to the shared boundary converter. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Lock mapcorr's nonsquare method choice with a test. Method 0 on a 2-by-3 map stays the Hungarian pairing. EEGLAB would force method 2 for that shape. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Format the nonsquare mapcorr method test. Ruff wants the method-0 call on one line. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* Fix single-function Python-backend parity gaps. Match EEGLAB for the local bugs behind the strict xfails: numeric history keys, EEG history return values, cell inputs, import layouts, epoch type cells, selection ranges, and the small numeric helpers. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Drop Python-backend xfails that now pass. pop_chanevent accepts the double channel index, and importevent's remaining failure is the struct-array return. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Leave MATLAB transport shapes to the boundary converter. Whole-number floats, object-array cells, and nested 1x1 type cells belong in the shared converter. Dataset history appends every command, matching eeg_hist.m. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Record dataset history through eeg_hist. eegh.m calls eeg_hist for one dataset and for each dataset in a list, so character-matrix and row-list history stay lines and pop_loadset is skipped. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* Match EEGLAB mmo growth, deletion, and single-precision FIR MemmapData grows on out-of-range assignment, folds trailing dimensions on a short empty assignment, and reports copy-on-write the way @mmo does. FIR filtering casts single-precision input back to float32 after the float64 filter so mapped and in-memory datasets match. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Keep NumPy indexing separate from EEGLAB mmo assignment Boolean deletion uses find, so an all-false mask removes nothing. Growth and empty-assignment deletion move to matlab_assign. Legacy eegfilt keeps the float64 result. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Keep pop_eegfilt's dtype when a boundary splits the data Continuous data with a boundary event keeps the input class for both arrays and memory maps. Other legacy eegfilt results stay float64. The filter still runs in double. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Document eegfilt single-precision rounding and test pop_eegfilt class EEGLAB eegfilt.m:210 filters a single row in single precision. State that difference without a fixed gap, and compare pop_eegfilt's output class with EEGLAB for the four continuous and epoched cases. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Cover the causal eegfilt path in the single-precision note eegfilt.m:209 uses filter and :210 uses filtfilt, both on single input, with a double fallback only on error. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* Accept EEGLAB name/value pairs in runica and related functions runica, runicalowmem, dftfilt3, make_timewarp, pop_biosig, pop_fileio, and pop_editoptions parse positional pairs with parse_key_value_args. This clears nine Python-backend xfails that failed before the call returned. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Accept newtimef name/value pairs and document rndreset newtimef parses EEGLAB positional pairs and returns mbase as a row. An omitted runica rndreset stays off, matching the help text rather than the true constant. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Accept the newtimef finputcheck list and leave MATLAB doubles uncoerced newtimef ignores unknown names and follows ntimesout, plotamp, maxfreq, and itctype precedence. runica and pop_editoptions no longer coerce integer-valued floats, so the pca reference test is xfailed for the boundary converter. make_timewarp raises ValueError for unknown names. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Pass integer runicalowmem limits in the name/value unit test The pair test was sending maxsteps 1.0, which runica no longer coerces to int. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Forward newtimef's leftover options to timefreq Drop the frames and naccu float casts. A scalar freqs keeps its first value when maxfreq replaces the second, and names timefreq accepts are forwarded instead of ignored. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Let a forwarded newtimef wavelet replace cycles newtimef passes g.cycles as wavelet and then the leftover options, so the last wavelet value wins. Undefined-argument errors keep the caller's spelling. freqrange, erspboot, and itcboot are rejected; overlap and rng stay. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Document newtimef wavelet scaling and reject overlap EEGPrep still scales the decomposition that ran. The reference test now locks EEGLAB's original-cycles scale, and overlap is an undefined argument. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Derive newtimef wavelet-scale tolerances from the rounding MATLAB-to-MATLAB power uses 20u relative. NumPy-to-MATLAB uses the measured 3 ulp gap. Docs cite the default window and lines 1207-1209. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com>
* Return double-precision ANOVA F and p from statcond EEGLAB #977 accumulates ANOVA sums of squares in double and evaluates the tail with myfpval. Package those results as float64, drop the 20 strict ANOVA expected failures, and compare the zero-tolerance fixtures with a roundoff bound. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Match ANOVA F resampling class to arraycomp. Arraycomp on replaces the single preallocation with the double ANOVA output, so those resampling arrays and their confidence intervals are float64; arraycomp off stays float32. Apply repeated-measures kappa and the F-to-p condition per element, and add a measured betainc allowance. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Raise the measured betainc allowance to 2048 ulps. The full-range MATLAB sweep reaches 1966.5u as p goes to 1e-300, and SciPy on this machine stays under 70u, so one power-of-two constant covers their sum. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Keep t-test and supplied statcond array classes. t-test confidence intervals follow the single surrogate class, and a supplied statistic or resampling array keeps the class it was given. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Give supplied statcond class tests a matching statistic shape. The observed statistic has to line up with the surrogate array once its last axis is removed. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Accept an [n 1] supplied statistic in statcond. Reshape supplied stats to the resampling array without its last axis when the element counts match, which is the column MATLAB broadcasts. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Reject supplied stats that would reorder statcond p-values. Accept a supplied statistic only when its shape matches the resampling array without the last axis after trailing length-1 dimensions are removed. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Wrap the overlong statcond line in the development notes. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> * Repin eeglab_tests to the merged suite commit. fec88f9ffe7c225eb1de8924db8b6a3e0d53a4d9 is the squash merge of eeglab_tests #16 on master. t_statcond.mat is unchanged. Co-authored-by: Suraj Ranganath <suraj.ranganath@gmail.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Return and reapply the ASR calibration state
…kend # Conflicts: # docs/source/changelog.rst
Add pop_runica icatype pamica through eeg_pamica
…ions (#626) * Read a store's electrode attributes into the window * Fill chanlocs in to_eeg from electrode attributes * Document electrode locations in eegprep-lean * Note the EEGLAB description case in the docs
#627) * Pin empty and null attributes as no attributes * Name the refusal of a non-object position map * Read a huge integer coordinate as no position * Read every zero coordinate as positive zero * Note the reader edge cases in the changelogs
Record develop as merged into the epic with a real merge commit. The earlier sync (#628) was squash-merged, so its content carries the resolution of the 30 conflicts but its history does not list develop as a parent, and pull request 386 showed conflicts again. Every conflicting file keeps the epic's content, which already holds that resolution. The files that #627 changed after the first sync (the eegprep-lean reader and tests, and both changelogs) take develop's newer content; docs/source/changelog.rst carries both the epic's entries and the #627 entry. The tree differs from the epic head by exactly the diff of #627. Land this branch with "Create a merge commit", never squash or rebase.
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 @neuromechanist's task in 57s —— View job Code review
What I checked (head
|
Land this pull request with "Create a merge commit"
This branch is a REAL MERGE COMMIT of
developintoepic/324-pyodide-browser, with two parents: the epic head (3c9d091) and the currentdeveloptip (2736f99).It MUST BE LANDED WITH "Create a merge commit" (not squash, not rebase).
A squash drops the second parent and brings back the conflicts of pull request #386, which is exactly what happened to #628.
The alternative is for the owner to fast-forward the epic branch to this branch with a push, which keeps the same two-parent history.
Why this exists
#628 merged develop into the epic with a squash (one parent).
Its content carries the resolution of the 30 conflicts, but its history does not record
developas merged, so the merge base of the two branches stayed at f6781b4 and #386 showed CONFLICTING again.The epic also lacks #627, which was merged into
developafter the sync.What the merge does
develop(including e53d3aa and [eegprep-lean] Fix edge cases in reading a store's electrode positions #627) as an ancestor of the epic.develop's newer content (the epic's copy was identical to the first sync's):packages/eegprep-lean/CHANGELOG.md,src/eegprep_lean/__init__.py,src/eegprep_lean/electrodes.py,tests/test_eeg.pyandtests/test_recording.py.docs/source/changelog.rst, is a three-way merge: the epic's entries plus the [eegprep-lean] Fix edge cases in reading a store's electrode positions #627 entry (the epic has its own changelog entries thatdeveloplacks).Invariant check
The tree of this branch differs from the epic head by exactly the diff of #627 (
git diff e53d3aa7 origin/develop, the only commit ondevelopafter the first sync).Compared line by line with the
indexheader lines removed, the two patches are identical except for one hunk header offset indocs/source/changelog.rst(-50,6here against-20,6ondevelop), because the epic's changelog has 30 more lines above that spot.No other file differs.
Gates run locally on the merge commit
./pre-commit.py --changed-from origin/develop: OKruff check .: all checks passed;ruff format --check .: 966 files already formattedty check: all checks passeduv lock --check: resolved 182 packages, lock currentpytest tests, MATLAB skipped, offscreen Qt, the pamica E1 report deselected): 3,025 passed, 5 failed, 151 skipped. The 5 failures are the same five as the first sync's baseline (3,023 passed, 5 failed):test_process_r_updates_final_sample_when_length_mod_step_is_oneand the four BLAS-warning tests intests/test_sample_data_pop_functions.py.Not run: the MATLAB reference workflow and the Pyodide job.