SweepFormula does not expand variables in arrays
Closed this issue · 3 comments
Reported by Tim:
The following SF code
selDA=select(channels(DA0), sweeps())
start=max(epochs(E1, $selDA))
end=max(epochs(E1, $selDA))+500
startEnd=[$start,$end]
$startEnd
gives "Cannot plot a single text wave".
Reproduced with 5c9352e (Merge pull request #2136 from AllenInstitute/bugfix/2136-use-more-ip9-features, 2024-06-10) and, if I remove the + 500
also with d57ec82 (Merge pull request #2070 from AllenInstitute/bugfix/2070-fix_sort_epochs-backport, 2024-03-17).
I thought this is a fallout from ab54d19 (Merge pull request #2133 from AllenInstitute/feature/2133-sf_support_operation_results_in_arrays, 2024-06-10) but it is not.
Relevant comment as well:
It's also possible to get start or end to return as text if I wrap them in square brackets. e.g., start= [(max(epochs(E1, $selDA)))]
Related
selDA=select(channels(DA0), sweeps())
selAD=select(channels(AD0), sweeps())
data([min(epochs(E1, $selDA)), max(epochs(E1, $selDA))], $selAD)
does give an empty plot 5c9352e (Merge pull request #2136 from AllenInstitute/bugfix/2136-use-more-ip9-features, 2024-06-10) and bugs out with 5d40b87 (Merge pull request #2139 from AllenInstitute/feature/2139-add_IPA_control_code, 2024-06-08).
The reason for the empty plot is that SFH_GetRangeFromEpoch does think that a range of type textwave holds epoch names but it does hold WREF style entries.
For SFH_EvaluateRange add a generic function that does the following:
- if all array elements have the same number of datasets and the same type then create this number of datasets and put arrays of that type from the datasets in a wave in each dataset (move datasets one level up)
FormulaPlotter before:
numData = DimSize(formulaResults, ROWS)
for(k = 0; k < numData; k += 1)
Also attempt the upper method and clone X FormulaResults accordingly.