Skip to content

Commit

Permalink
Merge pull request #2347 from AllenInstitute/feature/2347-update-ipt
Browse files Browse the repository at this point in the history
CI: Update ipt
  • Loading branch information
t-b authored Feb 14, 2025
2 parents d95d80e + d9733d4 commit f4a3c4d
Show file tree
Hide file tree
Showing 163 changed files with 1,301 additions and 640 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
uses: actions/checkout@v4
# no need to checkout submodules or the full history
- name: Download ipt binary from server
run: curl -o ipt.exe "https://byte-physics.de/public-downloads/aistorage/transfer/ipt/0.6.0/ipt.exe"
run: curl -o ipt.exe "https://byte-physics.de/public-downloads/aistorage/transfer/ipt/0.7.11/ipt.exe"
- name: IPT version
run: ./ipt.exe --version
- name: Format and lint code
Expand Down
6 changes: 3 additions & 3 deletions Packages/Conversion/MIES_MassExperimentProcessing.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#ifdef AUTOMATED_TESTING
#pragma ModuleName=MIES_MEP
#endif
#endif // AUTOMATED_TESTING

/// @file MIES_MassExperimentProcessing.ipf
/// @brief __MEP__ Process multiple MIES pxps to convert data into NWBv2
Expand Down Expand Up @@ -38,7 +38,7 @@ static StrConstant OUTPUT_FOLDER = "C:tim-data:output:"
static StrConstant INPUT_FOLDER = ""
static StrConstant OUTPUT_FOLDER = ""

#endif
#endif // MEP_DEBUGGING

Menu "Macros"
"Mass convert PXPs to NWBv2", /Q, StartMultiExperimentProcess()
Expand Down Expand Up @@ -342,4 +342,4 @@ Function TestMe()
ProcessCurrentExperiment(prefs)
End

#endif
#endif // MEP_DEBUGGING
2 changes: 1 addition & 1 deletion Packages/MIES/DR_MIES_TangoInteract.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#ifdef AUTOMATED_TESTING
#pragma ModuleName=MIES_DR_TI
#endif
#endif // AUTOMATED_TESTING

/// @file DR_MIES_TangoInteract.ipf
///
Expand Down
8 changes: 4 additions & 4 deletions Packages/MIES/MIES_AcceleratedModifyGraph.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#ifdef AUTOMATED_TESTING
#pragma ModuleName=MIES_ACC
#endif
#endif // AUTOMATED_TESTING

static Constant ACC_MAX = 1024

Expand Down Expand Up @@ -47,7 +47,7 @@ static Function/S GenerateValueString(variable type, variable keywordIndex, vari
break
case GEN_TYPE_WAVE:
for(i = 0; i < numEntryCols; i += 1)
sprintf str, "s%d[h%s][%d]%s", keywordIndex, indexStr, i, SelectString(i < numEntryCols - 1, "", ",")
sprintf str, "s%d[h%s][%d]%s", keywordIndex, indexStr, i, SelectString(i < (numEntryCols - 1), "", ",")
result += str
endfor

Expand Down Expand Up @@ -84,13 +84,13 @@ static Function GenerateAcceleratedModifyGraphCaseImpl(WAVE/T keyword, variable
for(j = 0; j < numKeywords; j += 1)
printf "%s($w[h%s])=%s", keyword[j], indexStr, GenerateValueString(type[j], j, numEntryCols[j], indexStr)

if(j < numKeywords - 1)
if(j < (numKeywords - 1))
printf ","
endif
endfor

if(mod(i + 1, 8) == 0)
if(i + 1 != numEntries)
if((i + 1) != numEntries)
printf " \\"
endif

Expand Down
4 changes: 2 additions & 2 deletions Packages/MIES/MIES_AcquisitionStateHandling.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#ifdef AUTOMATED_TESTING
#pragma ModuleName=MIES_ACQSTATE
#endif
#endif // AUTOMATED_TESTING

/// @file MIES_AcquisitionStateHandling.ipf
/// @brief __AS__ Acquisition state handling
Expand Down Expand Up @@ -75,7 +75,7 @@ Function AS_HandlePossibleTransition(string device, variable newAcqState, [varia

#ifdef AUTOMATED_TESTING
AS_RecordStateTransition(oldAcqState, newAcqState)
#endif
#endif // AUTOMATED_TESTING

if(!AS_CheckStateTransition(oldAcqState, newAcqState))
sprintf msg, "The state transition %s -> %s is not expected.", AS_StateToString(oldAcqState), AS_StateToString(newAcqState)
Expand Down
15 changes: 8 additions & 7 deletions Packages/MIES/MIES_AmplifierInteraction.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#ifdef AUTOMATED_TESTING
#pragma ModuleName=MIES_AI
#endif
#endif // AUTOMATED_TESTING

/// @file MIES_AmplifierInteraction.ipf
/// @brief __AI__ Interface with the Axon/MCC amplifiers
Expand Down Expand Up @@ -230,7 +230,7 @@ Function AI_UpdateAmpModel(string device, string ctrl, variable headStage, [vari

WAVE statusHS = DAG_GetChannelState(device, CHANNEL_TYPE_HEADSTAGE)
if(!sendToAll)
statusHS[] = (p == headStage ? 1 : 0)
statusHS[] = ((p == headStage) ? 1 : 0)
endif

if(!CheckIfValueIsInsideLimits(device, ctrl, value))
Expand All @@ -247,7 +247,8 @@ Function AI_UpdateAmpModel(string device, string ctrl, variable headStage, [vari
case "button_DataAcq_AutoPipOffset_VC":
runMode = TP_StopTestPulseFast(device)
default:
// do nothing
// do nothing
break
endswitch

for(i = 0; i < NUM_HEADSTAGES; i += 1)
Expand Down Expand Up @@ -887,7 +888,7 @@ Function AI_GetHoldingCommand(string device, variable headstage)
return NaN
endif

return MCC_GetHoldingEnable() ? MCC_GetHolding() * AI_GetMCCScale(MCC_GetMode(), MCC_GETHOLDING_FUNC) : 0
return MCC_GetHoldingEnable() ? (MCC_GetHolding() * AI_GetMCCScale(MCC_GetMode(), MCC_GETHOLDING_FUNC)) : 0
End

/// @brief Return the clamp mode of the headstage as returned by the amplifier
Expand Down Expand Up @@ -1579,7 +1580,7 @@ Function AI_QueryGainsFromMCC(string device)
MCC_SetHoldingEnable(0)
clampModeSwitchAllowed = 1
endif
#endif
#endif // AUTOMATED_TESTING

if(clampModeSwitchAllowed)
old_clampMode = clampMode
Expand All @@ -1593,7 +1594,7 @@ Function AI_QueryGainsFromMCC(string device)
AI_SetClampMode(device, i, old_clampMode)
else
printf "It appears that a holding potential is being applied, therefore as a precaution, "
printf "the gains cannot be imported for the %s.\r", ConvertAmplifierModeToString(clampMode == V_CLAMP_MODE ? I_CLAMP_MODE : V_CLAMP_MODE)
printf "the gains cannot be imported for the %s.\r", ConvertAmplifierModeToString((clampMode == V_CLAMP_MODE) ? I_CLAMP_MODE : V_CLAMP_MODE)
printf "The gains were successfully imported for the %s on i: %d\r", ConvertAmplifierModeToString(clampMode), i
endif
endfor
Expand Down Expand Up @@ -1723,4 +1724,4 @@ Function [STRUCT AxonTelegraph_DataStruct tds] AI_GetTelegraphStruct(variable ax

DEBUGPRINT("Unimplemented")
End
#endif
#endif // AMPLIFIER_XOPS_PRESENT
51 changes: 42 additions & 9 deletions Packages/MIES/MIES_AnalysisBrowser.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#ifdef AUTOMATED_TESTING
#pragma ModuleName=MIES_AB
#endif
#endif // AUTOMATED_TESTING

/// @file MIES_AnalysisBrowser.ipf
/// @brief __AB__ Analysis browser
Expand Down Expand Up @@ -174,7 +174,7 @@ static Function AB_RemoveMapEntry(variable index)
endif
map[index][] = ""

if(index + 1 == GetNumberFromWaveNote(map, NOTE_INDEX))
if((index + 1) == GetNumberFromWaveNote(map, NOTE_INDEX))
SetNumberInWaveNote(map, NOTE_INDEX, index)
endif
End
Expand Down Expand Up @@ -1008,6 +1008,9 @@ static Function/S AB_LoadLabNotebookFromFile(string discLocation)
case ANALYSISBROWSER_FILE_TYPE_NWBv2:
deviceList = AB_LoadLabNotebookFromNWB(map[%DiscLocation])
break
default:
ASSERT(0, "Unsupported file type")
break
endswitch

return deviceList
Expand Down Expand Up @@ -1370,7 +1373,7 @@ static Function AB_CollapseListEntry(variable row, variable col)
WAVE expBrowserSelBak = CreateBackupWave(expBrowserSel)

mask = expBrowserSel[row][col]
ASSERT(mask & LISTBOX_TREEVIEW && !(mask & LISTBOX_TREEVIEW_EXPANDED), "listbox entry is not a treeview expansion node or is already collapsed")
ASSERT((mask & LISTBOX_TREEVIEW) && !(mask & LISTBOX_TREEVIEW_EXPANDED), "listbox entry is not a treeview expansion node or is already collapsed")

last = AB_GetRowWithNextTreeView(expBrowserSel, row, col)
colSize = DimSize(expBrowserSel, COLS)
Expand Down Expand Up @@ -1403,14 +1406,14 @@ static Function AB_ExpandListEntry(variable row, variable col)
WAVE expBrowserSelBak = CreateBackupWave(expBrowserSel)

mask = expBrowserSel[row][col]
ASSERT(mask & LISTBOX_TREEVIEW && mask & LISTBOX_TREEVIEW_EXPANDED, "listbox entry is not a treeview expansion node or already expanded")
ASSERT((mask & LISTBOX_TREEVIEW) && (mask & LISTBOX_TREEVIEW_EXPANDED), "listbox entry is not a treeview expansion node or already expanded")

lastExpandedRow = NaN
last = AB_GetRowWithNextTreeView(expBrowserSel, row, col)
colSize = DimSize(expBrowserSel, COLS)
for(i = last - 1; i >= row; i -= 1)
for(j = colSize - 1; j >= col; j -= 1)
val = i == row && j == col ? ClearBit(mask, LISTBOX_TREEVIEW_EXPANDED) : expBrowserSel[i][j]
val = (i == row && j == col) ? ClearBit(mask, LISTBOX_TREEVIEW_EXPANDED) : expBrowserSel[i][j]
if(!(val & LISTBOX_TREEVIEW))
continue
endif
Expand Down Expand Up @@ -1537,7 +1540,7 @@ static Function AB_LoadFromExpandedRange(variable row, variable subSectionColumn
endif
device = ""
else
if(expBrowserSel[j][EXPERIMENT_TREEVIEW_COLUMN] & LISTBOX_TREEVIEW || expBrowserSel[j][DEVICE_TREEVIEW_COLUMN] & LISTBOX_TREEVIEW)
if((expBrowserSel[j][EXPERIMENT_TREEVIEW_COLUMN] & LISTBOX_TREEVIEW) || (expBrowserSel[j][DEVICE_TREEVIEW_COLUMN] & LISTBOX_TREEVIEW))
// ignore rows with tree view icons, we have them already in our list
continue
endif
Expand Down Expand Up @@ -1598,7 +1601,7 @@ static Function AB_GetRowWithNextTreeView(WAVE selWave, variable startRow, varia

numRows = DimSize(selWave, ROWS)
for(i = startRow + 1; i < numRows; i += 1)
status[] = (selWave[i][p] & LISTBOX_TREEVIEW ? 1 : 0)
status[] = ((selWave[i][p] & LISTBOX_TREEVIEW) ? 1 : 0)

if(Sum(status, 0, col) > 0)
return i
Expand Down Expand Up @@ -2033,7 +2036,7 @@ static Function AB_SortConfigSweeps(WAVE/I config)
Make/FREE/N=(numRows)/I/U valindex = p

//sort order: XOP_CHANNEL_TYPE_DAC = 1, XOP_CHANNEL_TYPE_ADC = 0, XOP_CHANNEL_TYPE_TTL = 3
MultiThread keyPrimary[] = config[p][%type] == XOP_CHANNEL_TYPE_ADC ? 2 : config[p][%type]
MultiThread keyPrimary[] = (config[p][%type] == XOP_CHANNEL_TYPE_ADC) ? 2 : config[p][%type]
MultiThread keySecondary[] = config[p][%number]
Sort/A {keyPrimary, keySecondary}, valindex

Expand Down Expand Up @@ -2523,7 +2526,7 @@ static Function AB_AddExperimentEntries(string win, WAVE/T entries)
ControlWindowToFront()
continue
endif
if(sTime < stopMSTimer(-2) * MILLI_TO_ONE)
if(sTime < (stopMSTimer(-2) * MILLI_TO_ONE))
sprintf title, "%s, Reading %s", panel, GetFile(fName)
DoWindow/T $panel, title
DoUpdate/W=$panel
Expand Down Expand Up @@ -2660,6 +2663,8 @@ Function AB_ButtonProc_ExpandAll(STRUCT WMButtonAction &ba) : ButtonControl
AB_ExpandListColumn(EXPERIMENT_TREEVIEW_COLUMN)
AB_ExpandListColumn(DEVICE_TREEVIEW_COLUMN)
break
default:
break
endswitch

return 0
Expand All @@ -2674,6 +2679,8 @@ Function AB_ButtonProc_CollapseAll(STRUCT WMButtonAction &ba) : ButtonControl
AB_CollapseListColumn(DEVICE_TREEVIEW_COLUMN)
AB_CollapseListColumn(EXPERIMENT_TREEVIEW_COLUMN)
break
default:
break
endswitch

return 0
Expand Down Expand Up @@ -2701,6 +2708,8 @@ Function AB_ButtonProc_LoadSweeps(STRUCT WMButtonAction &ba) : ButtonControl
KillWindow $graph
endif
break
default:
break
endswitch

return 0
Expand All @@ -2713,6 +2722,8 @@ Function AB_ButtonProc_LoadBoth(STRUCT WMButtonAction &ba) : ButtonControl
case 2:
PGC_SetAndActivateControl(ba.win, "button_load_stimsets")
PGC_SetAndActivateControl(ba.win, "button_load_sweeps")
default:
break
endswitch

return 0
Expand All @@ -2732,6 +2743,8 @@ Function AB_ButtonProc_LoadStimsets(STRUCT WMButtonAction &ba) : ButtonControl
WBP_CreateWaveBuilderPanel()
endif
break
default:
break
endswitch

return 0
Expand Down Expand Up @@ -2783,6 +2796,8 @@ Function AB_ButtonProc_Refresh(STRUCT WMButtonAction &ba) : ButtonControl

AB_UpdateColors()
break
default:
break
endswitch

return 0
Expand Down Expand Up @@ -2817,6 +2832,8 @@ Function AB_ButtonProc_OpenFolders(STRUCT WMButtonAction &ba) : ButtonControl
endfor
KillPath/Z $symbPath
break
default:
break
endswitch

return 0
Expand All @@ -2843,6 +2860,8 @@ Function AB_ButtonProc_Remove(STRUCT WMButtonAction &ba) : ButtonControl
endfor
AB_SaveSourceListInSettings()

break
default:
break
endswitch

Expand Down Expand Up @@ -2882,6 +2901,8 @@ Function AB_ButtonProc_AddFolder(STRUCT WMButtonAction &ba) : ButtonControl
Make/FREE/T wFolder = {folder}
AB_AddExperimentEntries(ba.win, wFolder)
break
default:
break
endswitch

return 0
Expand Down Expand Up @@ -2920,6 +2941,8 @@ Function AB_ButtonProc_AddFiles(STRUCT WMButtonAction &ba) : ButtonControl
WAVE/T selFiles = ListToTextWave(fileList, "\r")
AB_AddFiles(ba.win, selFiles)
break
default:
break
endswitch

return 0
Expand Down Expand Up @@ -3008,6 +3031,8 @@ Function AB_ButtonProc_SelectStimSets(STRUCT WMButtonAction &ba) : ButtonControl
expBrowserSel[indizes[i]][] = expBrowserSel[p][q] | LISTBOX_SELECT_OR_SHIFT_SELECTION
endfor

break
default:
break
endswitch

Expand Down Expand Up @@ -3056,6 +3081,8 @@ Function AB_ListBoxProc_ExpBrowser(STRUCT WMListboxAction &lba) : ListBoxControl
endif
AB_UpdateColors()

break
default:
break
endswitch

Expand Down Expand Up @@ -3141,6 +3168,8 @@ Function AB_ButtonProc_OpenCommentNB(STRUCT WMButtonAction &ba) : ButtonControl
NewNoteBook/K=1/F=0/OPTS=(2^2 + 2^3)/N=$commentNotebook/W=(0, 0, 300, 400) as titleString
ReplaceNotebookText(commentNotebook, comment)
break
default:
break
endswitch

return 0
Expand Down Expand Up @@ -3181,6 +3210,8 @@ Function AB_ButtonProc_ResaveAsNWB(STRUCT WMButtonAction &ba) : ButtonControl
AB_ReExport(i, overwrite)
endfor
break
default:
break
endswitch
End

Expand Down Expand Up @@ -3504,6 +3535,8 @@ Function AB_WindowHook(STRUCT WMWinHookStruct &s)
AB_MemoryFreeMappedDF()
AB_RemoveEmptyWorkingDF()

break
default:
break
endswitch

Expand Down
2 changes: 1 addition & 1 deletion Packages/MIES/MIES_AnalysisBrowser_Macro.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#ifdef AUTOMATED_TESTING
#pragma ModuleName=MIES_ABMACRO
#endif
#endif // AUTOMATED_TESTING

/// @file MIES_AnalysisBrowser.ipf
/// @brief __ABM__ Analysis browser Macro
Expand Down
Loading

0 comments on commit f4a3c4d

Please sign in to comment.