Skip to content

[GUI] Fix tf_cycle_calc dialog crash on blank or vector frequencies - #933

Open
claude[bot] wants to merge 1 commit into
developfrom
agent/20261201-fix-928
Open

claude[bot] wants to merge 1 commit into
developfrom
agent/20261201-fix-928

Conversation

@claude

@claude claude Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Parse the pop_newtimef frequency text with parse_numeric_sequence when prefilling the tf_cycle_calc dialog. The previous np.asarray call raised on blank text and vectors such as 8 16, so the calculator only opened for scalars. Layout and window height parity remain open in the issue.

Part of #928

🤖 Generated with Claude Code

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Code review skipped — your organization has no extra usage available to pay for this review.

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

claude Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor Author

Claude finished @claude[bot]'s task in 35s —— View job


Code review

  • Overall assessment: Looks good. _format_vector now uses the shared parse_numeric_sequence helper instead of np.asarray(..., dtype=float). The helper handles the text that _run_tf_cycle_calc passes from the pop_newtimef frequency field (qt.py:779): blank text gives an empty list, and 8 16, [3 50], 3, 50 and 8:4:16 are all parsed. Removing the numpy import and the explicit None and empty checks is correct, because the helper already covers both.
  • Highest-risk area: None identified.
  • Merge recommendation: Safe to merge.

Blocking

None.

Important

None.

Nits

None.

Test gaps

None. The new parametrized test covers the three input shapes that used to crash (blank, space-separated vector, MATLAB range) plus the scalar case that already worked.

EEGLAB parity notes

None. This PR only changes how the dialog prefills the frequency field. Per the description, layout and window-height parity are still tracked in #928.

Out of scope, and not caused by this PR: malformed frequency text such as abc still raises ValueError from float() inside _format_vector. That call happens before the try block in _run_tf_cycle_calc (qt.py:779), so the error is not caught. The old np.asarray call failed the same way. If this should behave like EEGLAB, where str2num returns empty for bad text, it belongs in a follow-up.

I could not run the tests in this job because the uv run pytest permission was denied. All findings come from reading the code.

I checked for correctness bugs, EEGLAB parity, data structure compatibility, tests for the changed behavior, and CLAUDE.md/AGENTS.md compliance.

@arnodelorme

Copy link
Copy Markdown
Collaborator

🤖 Nothing left to merge here: develop already contains this repair.

I tried to update this branch with develop as asked on December 1, 2026. The only conflict is in tf_cycle_calc_dialog.py, and develop's side already does the job: commit 80363ee55 ("Open the wavelet calculator with blank and vector frequency fields", November 30) repaired the same crash in another way and added its own tests and a recorded geometry case.

I ran the four cases of this pull request's test against develop 068ad1743, plus a list and an empty value. All give the expected text: "" gives "", "8 16" gives "8 16", "10" gives "10", "8:4:16" gives "8 12 16".

So after the conflict is resolved the branch adds no code, only a second test of the same behavior. I left the branch untouched and merged nothing. I suggest closing this pull request (and issue #928 if it is still open, since the crash is gone on develop).

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant