MIES icon indicating copy to clipboard operation
MIES copied to clipboard

Allow to create a list of sweep with some properties

Open t-b opened this issue 8 months ago • 2 comments

For select we have added a couple of special purpose selectors like SelIVSCCSweepQC which allows to select passing sweeps.

Now we have user requests for extending that to arbitrary things.

For example we want to generate a list of sweeps which have more than 5 spikes. This would need a new operation and a way to express the condition. Something like

getMatchingSweeps(<op>, <expr>)

would be in this case:

sel = select()
GetMatchingSweeps(apfrequency(data($sel), 0.1), "y > 5")

apfrequency returns x-y pairs of spikes and sweeps.

or you want all sweeps with a certain labnotebook entry:

sel = select()
GetMatchingSweeps(labnotebook("User Comment", $sel, UNKNOWN_MODE), "strlen(y) > 0")

Operators which spring to mind: <, >, <= , >=, ==, !=, IsNaN, strlen, !

Depending on how we implement this it might be also cheap to get && and ||.

t-b avatar Apr 09 '25 12:04 t-b

Thoughts from chat with @MichaelHuth:

The general approach is good. We can't circumvent the expression parsing from string as only that is flexible enough.

Options 1: Plain Execute

  • Pros
    • Straightforward
    • Allows any possible Igor Pro expression including user defined functions
  • Cons:
    • Execute is not threadsafe
    • Very likely bad error messages on errors in expressions

Options 2: Extend SF parser and/or create sub-parser

  • Pros:
    • Possible to make threadsafe
    • Good error messages
  • Cons:
    • More work

t-b avatar Apr 09 '25 17:04 t-b

Prefer Option 1.

timjarsky avatar May 12 '25 19:05 timjarsky