Skip to content

[GUI] Match the tf_cycle_calc dialog to EEGLAB #928

Done

Description

@arnodelorme

🤖 #930

TF cycle calc now opens when the parent time-frequency field is empty, a scalar, a frequency list or a range. Clicking OK returns the selected frequencies and calculated cycles to the parent. The calculator uses the four native rows. The largest vertical error is 0.54 px. This stacks on #927.

Blank field, parent visible before the fix

Scalar 10 Hz

Frequencies 8 and 16 Hz, parent visible before the fix

Control position histogram and numerical errors

All seven wavelet width units were compared on jamming using equivalent MATLAB and Python values, scalar and vector widths, and logarithmic spacing. The maximum difference across all eight output columns, divided by max(1, |MATLAB value|), was 0 (tolerance 1e-12).

Inputs and checks

The two failed baseline calls left the parent open, as shown. The focused tests drive the real child through submission and read the parent fields. Geometry and time-frequency suites reported 158 passed, 8 MATLAB Engine skips, 4 deselected. The independent seven-unit numerical run used MATLAB R2025b on jamming.

Verification and history

Compare the two native windows on jamming, including input, submission and output. Record both checkout SHAs and verify the active Python import path. Part of #875. Follow-up to #146, Follow-up: time-warped newtimef marker and cycle GUI workflows.

Activity

  1. claude commented on Dec 1, 2026

    @claude
    Contributor

    🤖 Plan:

    Research

    _run_tf_cycle_calc passes the raw freqs edit text to tf_cycle_calc_dialog_spec. _format_vector then calls np.asarray(text, dtype=float), which raises on "" and "8 16" (could not convert string to float). A scalar such as "10" happens to parse, so only that case opens the dialog. EEGLAB comcalc uses str2num, then tf_cycle_calc(freqs, freqs) always shows the GUI because width is empty.

    Relevant code:

    Proposed Fix

    Make _format_vector parse with parse_numeric_sequence, which accepts blank text, vectors and a:b:c ranges (done in #933, Part of #928). The layout and height mismatch has no visual-parity case yet. It needs a MATLAB capture against the EEGLAB uigeom = {[3 2 1] x4} dialog, so this issue stays open after #933.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions