Open MichaelHuth opened 1 month ago
@t-b I think the SF changes could be technically tested.
Here are some examples:
swp = sweeps([1...10], 23, [30...40], 42)
sel1 = select(channels(AD), sweeps(1,2), selectVis(all), selectIVSCCsweepQC(passed))
sel2 = select(channels(), sweeps(), selectVis(all), selectIVSCCsweepQC(passed))
rng = selectRange(epochs("E1", $sel1))
ep = epochs("E1", $sel1)
lnb = labnotebook(ADC, [$sel1,$sel1])
sel = select($sel1, $sel1)
#tp = tp(tpbase(), [$sel1, $sel1])
sel3 = select($sel1, selectRange($ep + [0, 0]))
#data([$sel1, $sel2])
#data($sel1)
#$lnb
#data([select(), 10]) # fails
#data([select(), abc]) # fails
data([select(), $sel1])
Arrays for the select argument are allowed for tp, labnotebook, data. epochs takes only a single select argument. Since the argument order of select is now free, it was not possible to replace sweeps() with e.g. [1,2]. Thus, sweeps() takes now sweep numbers as arguments like sweeps(1, 2).
Rules:
select()
data(select())
is the same as data([select()])
and can be furhter extended with data([$sel0, $sel1, $sel2, ...])
where each select is treated independently with its attributed ranges.The two expressions with the fails comment relate to the adapted formula executor.
I am currently looking into an issue where:
ep = epochs(E1, select())
selectRange($ep + [0, 0]) # works
selectRange(epochs(E1, select()) + [0, 0]) # fails parsing
pushed a preliminary fix
@timjarsky Ready for playing around.
Tim and I played around today. And it is very nice!
I have compiled a list of items to look at:
[x] BSP_CheckProc_ChangedSetting(...)#L1293 [MIES_BrowserSettingsPanel.ipf] UpdateSweepPlot(...)#L6407 [MIES_MiesUtilities.ipf] SB_UpdateSweepPlot(...)#L357 [MIES_AnalysisBrowser_SweepBrowser.ipf] PostPlotTransformations(...)#L3970 [MIES_MiesUtilities.ipf] SF_Update(...)#L2764 [MIES_SweepFormula.ipf] PGC_SetAndActivateControl(...)#L231 [MIES_ProgrammaticGUIControl.ipf] SF_button_sweepFormula_display(...)#L2812 [MIES_SweepFormula.ipf] SF_ExecuteVariableAssignments(...)#L5990 [MIES_SweepFormula.ipf] SF_FormulaExecutor(...)#L1160 [MIES_SweepFormula.ipf] SF_OperationSelect(...)#L4925 [MIES_SweepFormula.ipf] JWN_SetStringInWaveNote(...)#L239 [MIES_JSONWaveNotes.ipf]
Time: 2024-06-07T15:20:03+02:00
Experiment: Basic (Packed)
Igor Pro version: 9.0.6.1 (56657)
################################
The line
JWN_SetStringInWaveNote(selectResult, SF_META_DATATYPE, SF_DATATYPE_SELECT)
in SF_OperationSelect needs to check if selectResult is null.
[x] selectVis should have a default argument value of "displayed"
[x] selectCM should have a default argument value of "all"
[x] selectCM(all) does not select anything
[x] Change prefix from sub-operations from select to sel to make it shorter
[x] Prefix channels and sweeps with sel
[x] Typo: sonly
[x] SFH_IsValidSingleSelection: Please add a generic function which returns a wave with matches given a wildcard expresssion. There is nothing builtin into IP IIRC only stringmatch and ListMatch.
for(matchSet : filter.stimsets)
if(stringmatch(setName, matchSet))
found = 1
break
endif
endfor
if(!found)
return 0
endif
note: The upper approach can already be done through FindIndizes with property wildcard matching. The utility function will return just true/false as the quoted code does.
*
we could avoid that.selectRange()
meaning the full rangeMoved to issues:
@MichaelHuth CI will not run when you have merge conflicts.
@MichaelHuth How is the cursor
operation handled by the changes here? Would you do selectRange(cursors(A, B))
?
@timjarsky Does it make sense to add another selector selExp
to select the experiment name? This would come in handy if you have sweeps from different experiments in one sweepbrowser. And what about selDev
for selecting the device? And selSCI
/selRAC
?
Yes, those all make sense. Thanks @t-b
@MichaelHuth How is the
cursor
operation handled by the changes here? Would you doselectRange(cursors(A, B))
?
cursors is not changed and returns an untyped array.
selRange returns datasets of ranges and has a datatype that allows it to be used with select as the datatype enables to have unordered select arguments.
So selrange(cursors(A,B))
gets the cursor range. You can not use cursors
as replacement for selrange
. And you can only use two cursors in the argument of cursors inside selrange because selrange accepts only arrays with two elements (start / end).
Options would be:
So selrange(cursors(A,B)) gets the cursor range.
That's good enough.
Add wildcard support for selexp
, seldev
. Accept only a single match.
selsci
:
selsci
to fill up missing SCI sweeps numbers (they have the same channelType/channelNumber)selsci()
is present, it takes no argumentsselrac
:
needs only sweep, so extend result from selsweeps right away
Regarding device and experiment:
useful functions:
I've tried playing around, but I get an assertion when loading data from the analysisbrowser:
PGC_SetAndActivateControl(...)#L231 [MIES_ProgrammaticGUIControl.ipf]
AB_ButtonProc_LoadSweeps(...)#L2749 [MIES_AnalysisBrowser.ipf]
PGC_SetAndActivateControl(...)#L231 [MIES_ProgrammaticGUIControl.ipf]
BSP_ButtonProc_ChangeSweep(...)#L1485 [MIES_BrowserSettingsPanel.ipf]
UpdateSweepPlot(...)#L6410 [MIES_MiesUtilities.ipf]
SB_UpdateSweepPlot(...)#L374 [MIES_AnalysisBrowser_SweepBrowser.ipf]
PostPlotTransformations(...)#L3978 [MIES_MiesUtilities.ipf]
LayoutGraph(...)#L2561 [MIES_MiesUtilities.ipf]
TUD_GetUserDataAsWave(...)#L177 [MIES_TraceUserData.ipf]
GetSetIntersection(...)#L3876 [MIES_Utilities.ipf]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Time: 2024-06-26T13:26:17+02:00
Experiment: Experiment (Packed)
Igor Pro version: 9.0.6.1 (56657)
################################
The bug can also be reproduced with runwithOpts(testsuite = "UTF_TraceUserData.ipf")
in Basic.pxp.
I've tried playing around, but I get an assertion when loading data from the analysisbrowser:
That was some fallout from the FindIndizes change to double precision as TUD also uses the combination with GetSetIntersection. I have fixed that.
I have added now selsci and selrac.
Currently the performance bottleneck is FindDimLabel is GetLastSetting. It is called very often due to SF_GetSelectData calling GetActiveChannels that iterates over all channels of the type.
Ready for another try.
I checked also the GetLastSetting DimLabel speed up and for the select case I tried it shows a 20% - 25% performance increase.
selsci now adds the sweeps of the same channeltype/channelnumber, it does not add e.g. the DAC channels of the headstage if through selchannels only ADC was selected. Does that make sense or should it also add the corresponding other channeltype / channelnumber (i.e. always ADC + DAC) ?
Does that make sense or should it also add the corresponding other channeltype / channelnumber (i.e. always ADC + DAC) ?
Yes that makes sense.
I checked also the GetLastSetting DimLabel speed up and for the select case I tried it shows a 20% - 25% performance increase.
Is that percent or percentage points?
I checked also the GetLastSetting DimLabel speed up and for the select case I tried it shows a 20% - 25% performance increase.
Is that percent or percentage points?
Results from my "test" in seconds: | FindDimlabel | FindValue | |
---|---|---|---|
RAC | 5.7 | 4.25 | |
SCI | 0.3 | 0.24 |
Todo:
selRACIndex:
selSCIIndex: The index where scis have different id, not the index within an sci.
selSetCycleCount:
selSetSweepCount:
selSCIIndex: SCI 0: Sweep 0, 1, 2 with headstage at AD0 SCI 1: Sweep 3, 4, 5 same headstage Variant 1: select(selchannels(AD0), selsweeps(0, 3), selSCIIndex(1)) selection: Sweep 0, AD0 (id0) selection: Sweep 3, AD0 (id1) combined with SCI index 1 there is one result, because we have Sweep 3 AD0 with a different SCI id.
Variant 2: we do an implicit SCI expansion select(selchannels(AD0), selsweeps(0, 3), selSCIIndex(1)) selection: Sweep 0, AD0 (id0) Sweep 3, AD0 (id1) combined with SCI index 1 there are three results, because expanding Sweep 3 AD0 adds Sweep 4, 5 and all of these have id1.
Variant 2 can be accomplished by using selExpandSCI()
, thus we decide for variant 1.
Order:
close #2012