Skip to content

SweepFormula: fix parser handling of empty arrays#2749

Closed
t-b with Copilot wants to merge 31 commits into
copilot/fix-sweepformula-parser-issuesfrom
copilot/fix-sweepformula-parser-issues-again
Closed

SweepFormula: fix parser handling of empty arrays#2749
t-b with Copilot wants to merge 31 commits into
copilot/fix-sweepformula-parser-issuesfrom
copilot/fix-sweepformula-parser-issues-again

Conversation

Copilot AI commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Thanks for opening a PR in MIES ✨!

  • Code can only be merged if the continous integration tests pass
  • Please ensure that the branch is named correctly. See
    here for the detailed explanation.

Description

SweepFormula rejected [] (empty array) in the parser.

Changes

  • Empty arrays (MIES_SweepFormula_Parser.ipf): explicit empty-array construction in the array action, producing [] at top level and when nested ([1,[]], [[]]).
  • Parser guard (MIES_SweepFormula_Parser.ipf): relax the shared sign-evaluation assert needed for [] and add a guard so invalid () still reports a clear error instead of yielding null.
  • Tests (UTF_SweepFormula.ipf): added parser and execution coverage for [], [1,[]], and [[]], including evaluation of [] to an empty numeric wave.

Examples

// parser / executor
[]          // empty numeric wave
[1,[]]
[[]]

t-b and others added 28 commits July 14, 2026 15:04
- We now don't have two fit offset/slope values pairs anymore. The one without _DASCALE suffix now works like
  the one with _DASCALE suffix. It was an error to introduce a second pair. This also required a lot of other
  changes like in PSQ_DS_GetLabnotebookData.
- PSQ_DS_CalculateDAScale learned to output a special value for failing sweep QC with passing neg f-I slope QC
- Changed how we do fillin when the neg f-I slope criteria passes, see PSQ_DS_AddDAScaleFillinBeforeNegSlope
- Soften the criteria for passing neg f-I slope: Now it is enough if one of them is passing, see
  PSQ_DS_ConsecutivePasses
We want to have deterministic behaviour.
We need to correct when we go from fI slope indizes to DAScale indizes.

Bug introduced in bc9b4a1 (PSQ_DS_CalculateReachedFinalSlope: Take
DAScale value into account, 2024-07-26).
Otherwise we miss finding values larger than 1000.

Bug introduced in e8917b8 (PSQ_DAScale (Adapt): Enhance it, 2025-01-22)
and 9940687 (PSQ_DS_GatherDAScaleFillin: Fix logic to check for already
acquired DAScales, 2025-02-14).
We now output "Y: <yvalue>" for a general trace which is not from
anaFuncParam or labnotebook. We also deduplicate.
We now output a duplicated trace for each subgraph which has the sweep
numbers which were responsible for the data as text marker.

In addition a custom tooltip is added which displays the current Y value.
This provides little check as it has to reimplement the same logic as the
core code. Which does not check anything relevant.
Broken since 862f677 (PSQ_DS_ConsecutivePasses: Factor it out, 2025-01-22).
GetWindow XXX, hide returns in the 0th bit the truth that the window is
hidden. The fallout was that the restore button was missing when a
subwindow was hidden.

Broken since 43d6c9a (BSP_DynamicStartupSettings: Hide the button dynamically, 2025-06-11).
In the JSON configuration we have since d25ccce
(MIES_Configuration.ipf: Record the hide state of a window, 2025-06-11)
support for storing and reading the hide state of a window. For the
restore part we do the obvious SetWindow XXX, hide=YYY call. But that does
not react in the databrowser hide restore button to showup. As that only
reacts to killing the window.

Let's fix that.
…hancements

PSQ_DA_Scale Adaptive enhancements
Forgotten in fe291be (PSQ_DAScale: Various changes and fixes for
adaptive mode, 2026-03-24).
…r-things

Various fixes and report generator upgrade
Copilot AI assigned Copilot and t-b Jul 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because there is no eligible user to bill. To allow Copilot reviews on bot-authored pull requests, enable direct organization billing in your organization's Copilot settings.

Copilot AI changed the title [WIP] Fix parser handling of signed exponents, non-finite operands and empty arrays SweepFormula: fix parser handling of empty arrays Jul 21, 2026
Copilot finished work on behalf of t-b July 21, 2026 16:35
Copilot AI requested a review from t-b July 21, 2026 16:35
t-b and others added 3 commits July 21, 2026 18:55
SweepFormula: support signed exponents, non-finite operands and empty arrays

SweepFormula: fix compile error by using distinct names for converted operands

SweepFormula: guard empty parentheses and add nested empty-array tests

SweepFormula: align non-finite operand literals with executor (case-sensitive)

SweepFormula: document why one character suffices in sign evaluation

SweepFormula: use Inf literal consistent with executor

Initial plan

SweepFormula: split out empty array fix
@t-b
t-b force-pushed the copilot/fix-sweepformula-parser-issues-again branch from 7d5eec5 to dff2986 Compare July 21, 2026 17:04
@t-b t-b closed this Jul 21, 2026
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.

3 participants