Skip to content

Commit

Permalink
Merge pull request #1820 from AllenInstitute/bugfix/1820-enable-ttl-e…
Browse files Browse the repository at this point in the history
…pochs-nwb-export-in-tests
  • Loading branch information
t-b authored Jul 20, 2023
2 parents 2530b80 + 7e39003 commit ca807f0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
# straight from the documentation, see https://pre-commit.com/#github-actions-example
- name: set PY
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- uses: actions/cache@v1
- uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
Expand Down
1 change: 0 additions & 1 deletion Packages/MIES/MIES_Epochs.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,6 @@ End
threadsafe Function/WAVE EP_FetchEpochs(WAVE numericalValues, WAVE/T/Z textualValues, variable sweep, variable channelNumber, variable channelType)
variable index

/// @todo we don't yet write epoch info into the LBN
if(channelType != XOP_CHANNEL_TYPE_DAC && channelType != XOP_CHANNEL_TYPE_TTL)
return $""
endif
Expand Down
4 changes: 4 additions & 0 deletions Packages/MIES/MIES_MiesUtilities.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -4746,6 +4746,7 @@ threadsafe static Function/WAVE GetActiveChannelsTTL(WAVE numericalValues, WAVE

index = GetIndexForHeadstageIndepData(numericalValues)

// present since 2f56481a (DC_MakeNITTLWave: Document TTL settings and rework it completely, 2018-09-06)
WAVE/T/Z ttlChannels = GetLastSetting(textualValues, sweep, "TTL channels", DATA_ACQUISITION_MODE)
if(WaveExists(ttlChannels))
// NI hardware
Expand All @@ -4772,6 +4773,9 @@ threadsafe static Function/WAVE GetActiveChannelsTTL(WAVE numericalValues, WAVE
endif

// ITC hardware
//
// LBN entries are present since c54d32a1 (Rework sweep settings
// labnotebook interaction and add TTL info, 2015-07-03)
switch(TTLmode)
case TTL_HARDWARE_CHANNEL:

Expand Down
31 changes: 16 additions & 15 deletions Packages/tests/UTF_TestNWBExportV2.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -518,26 +518,27 @@ static Function TestTimeSeries(fileID, filepath, device, groupID, channel, sweep
FAIL()
endif

// epochs
// @todo TTL support
if(params.channelType == XOP_CHANNEL_TYPE_DAC && clampMode != I_EQUAL_ZERO_MODE)
// introduced in 18e1406b (Labnotebook: Add DA/AD ChannelType, 2019-02-15)
[WAVE setting, index] = GetLastSettingChannel(numericalValues, $"", sweep, "DA ChannelType", params.channelNumber, params.channelType, DATA_ACQUISITION_MODE)

// introduced in 18e1406b (Labnotebook: Add DA/AD ChannelType, 2019-02-15)
[WAVE setting, index] = GetLastSettingChannel(numericalValues, $"", sweep, "DA ChannelType", params.channelNumber, params.channelType, DATA_ACQUISITION_MODE)
// epochs
if(((params.channelType == XOP_CHANNEL_TYPE_DAC \
&& clampMode != I_EQUAL_ZERO_MODE \
&& WaveExists(setting) \
&& setting[index] == DAQ_CHANNEL_TYPE_DAQ)) \
|| params.channelType == XOP_CHANNEL_TYPE_TTL)

if(WaveExists(setting) && setting[index] == DAQ_CHANNEL_TYPE_DAQ)
CHECK_WAVE(epochs, WAVE_WAVE)
CHECK_WAVE(epochs, WAVE_WAVE)

idx = FindDimlabel(epochs, ROWS, channel)
CHECK_GE_VAR(idx, 0)
idx = FindDimlabel(epochs, ROWS, channel)
CHECK_GE_VAR(idx, 0)

WAVE/T/Z epochsSingleChannel = WaveRef(epochs, row=idx)
CHECK_WAVE(epochsSingleChannel, TEXT_WAVE)
WAVE/T/Z epochsSingleChannel = WaveRef(epochs, row=idx)
CHECK_WAVE(epochsSingleChannel, TEXT_WAVE)

WAVE/Z epochsLBN = EP_FetchEpochs(numericalValues, textualValues, sweep, params.channelNumber, params.channelType)
CHECK_WAVE(epochsLBN, TEXT_WAVE)
CHECK_EQUAL_TEXTWAVES(epochsLBN, epochsSingleChannel)
endif
WAVE/Z epochsLBN = EP_FetchEpochs(numericalValues, textualValues, sweep, params.channelNumber, params.channelType)
CHECK_WAVE(epochsLBN, TEXT_WAVE)
CHECK_EQUAL_TEXTWAVES(epochsLBN, epochsSingleChannel)
endif
End

Expand Down

0 comments on commit ca807f0

Please sign in to comment.