Skip to content

Commit

Permalink
stimuli: dont lose/change filename case of legacy playlists
Browse files Browse the repository at this point in the history
this code is only really used in the playlist converter
and in the tests, but it broke the tests on linux (#13),
and maybe should windows ever become case sensitive as seen
from python, this would break
  • Loading branch information
nzjrs committed May 17, 2021
1 parent 8154f66 commit 95a4e9a
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 30 deletions.
9 changes: 7 additions & 2 deletions flyvr/audio/stimuli.py
Original file line number Diff line number Diff line change
Expand Up @@ -761,9 +761,14 @@ def _parse_list(_s):
intensities = _parse_list(intensity)

chans = []
for chan_idx, chan_name in enumerate(stimFileName.split(';')):
for chan_idx, _chan_name in enumerate(stimFileName.split(';')):
_cnl = _chan_name.lower().strip()
if _cnl in {'optooff', 'optoon', 'square', 'sin', ''}:
chan_name = _chan_name.lower()
else:
chan_name = _chan_name

chan = _legacy_factory(chan_name=chan_name.lower(),
chan = _legacy_factory(chan_name=chan_name,
rate=int(rate),
silencePre=int(silencePre),
silencePost=int(silencePost),
Expand Down
32 changes: 16 additions & 16 deletions tests/test_data/nivedita_vr1/opto_nivamasan_10sON90sOFF.txt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ playlist:
audio:
- MATFileStim-a93f0de49a5c44ccae00a03c4b398b58:
attenuator: null
filename: silentstim_tdur4s
filename: silentStim_TDUR4s
frequency: -1.0
intensity: 0.0
max_value: 10.0
Expand All @@ -14,7 +14,7 @@ playlist:
sample_rate: 10000
- MATFileStim-6fc9b557d0f04a1bb1d6e93e62423da2:
attenuator: null
filename: 190712_opto_10son_90soff
filename: 190712_opto_10sON_90sOFF
frequency: -1.0
intensity: 9.0
max_value: 10.0
Expand All @@ -25,7 +25,7 @@ playlist:
sample_rate: 10000
- MATFileStim-bda2036a1c924242ab6d78a93d4c01e2:
attenuator: null
filename: 190712_opto_10son_90soff
filename: 190712_opto_10sON_90sOFF
frequency: -1.0
intensity: 8.0
max_value: 10.0
Expand All @@ -36,7 +36,7 @@ playlist:
sample_rate: 10000
- MATFileStim-f69e66e6cba24ed28f9506050bf5d93f:
attenuator: null
filename: 190712_opto_10son_90soff
filename: 190712_opto_10sON_90sOFF
frequency: -1.0
intensity: 7.0
max_value: 10.0
Expand All @@ -47,7 +47,7 @@ playlist:
sample_rate: 10000
- MATFileStim-f145b22e455b44ffae68e67d69bb5f09:
attenuator: null
filename: 190712_opto_10son_90soff
filename: 190712_opto_10sON_90sOFF
frequency: -1.0
intensity: 9.0
max_value: 10.0
Expand All @@ -58,7 +58,7 @@ playlist:
sample_rate: 10000
- MATFileStim-5e5204dbe9784edd9859e7bc277c58d3:
attenuator: null
filename: 190712_opto_10son_90soff
filename: 190712_opto_10sON_90sOFF
frequency: -1.0
intensity: 8.0
max_value: 10.0
Expand All @@ -69,7 +69,7 @@ playlist:
sample_rate: 10000
- MATFileStim-872b488e2587425da36c345956521b00:
attenuator: null
filename: 190712_opto_10son_90soff
filename: 190712_opto_10sON_90sOFF
frequency: -1.0
intensity: 7.0
max_value: 10.0
Expand All @@ -80,7 +80,7 @@ playlist:
sample_rate: 10000
- MATFileStim-3973492411014426b70cab46711f0dc5:
attenuator: null
filename: 190712_opto_10son_90soff
filename: 190712_opto_10sON_90sOFF
frequency: -1.0
intensity: 9.0
max_value: 10.0
Expand All @@ -91,7 +91,7 @@ playlist:
sample_rate: 10000
- MATFileStim-3550e07630b64b27b402a15600aa5072:
attenuator: null
filename: 190712_opto_10son_90soff
filename: 190712_opto_10sON_90sOFF
frequency: -1.0
intensity: 8.0
max_value: 10.0
Expand All @@ -102,7 +102,7 @@ playlist:
sample_rate: 10000
- MATFileStim-2628b5986d2b404c8810f49660e1b3c4:
attenuator: null
filename: 190712_opto_10son_90soff
filename: 190712_opto_10sON_90sOFF
frequency: -1.0
intensity: 7.0
max_value: 10.0
Expand All @@ -113,7 +113,7 @@ playlist:
sample_rate: 10000
- MATFileStim-9ee8dcd380a04b31b4df912ebd39f4a6:
attenuator: null
filename: 190712_opto_10son_90soff
filename: 190712_opto_10sON_90sOFF
frequency: -1.0
intensity: 9.0
max_value: 10.0
Expand All @@ -124,7 +124,7 @@ playlist:
sample_rate: 10000
- MATFileStim-b9c76d6035df430c9ff2bd20ae5dfc8b:
attenuator: null
filename: 190712_opto_10son_90soff
filename: 190712_opto_10sON_90sOFF
frequency: -1.0
intensity: 8.0
max_value: 10.0
Expand All @@ -135,7 +135,7 @@ playlist:
sample_rate: 10000
- MATFileStim-0d140d6fa25d4d818b55c64243dd5c96:
attenuator: null
filename: 190712_opto_10son_90soff
filename: 190712_opto_10sON_90sOFF
frequency: -1.0
intensity: 7.0
max_value: 10.0
Expand All @@ -146,7 +146,7 @@ playlist:
sample_rate: 10000
- MATFileStim-745fddf21fc44a53a8742f0433b7d8be:
attenuator: null
filename: 190712_opto_10son_90soff
filename: 190712_opto_10sON_90sOFF
frequency: -1.0
intensity: 9.0
max_value: 10.0
Expand All @@ -157,7 +157,7 @@ playlist:
sample_rate: 10000
- MATFileStim-d296cd7c212542b2bd7d47e29eec0915:
attenuator: null
filename: 190712_opto_10son_90soff
filename: 190712_opto_10sON_90sOFF
frequency: -1.0
intensity: 8.0
max_value: 10.0
Expand All @@ -168,7 +168,7 @@ playlist:
sample_rate: 10000
- MATFileStim-dc0dab4af8c846e0b9bcb99a6ad44d41:
attenuator: null
filename: 190712_opto_10son_90soff
filename: 190712_opto_10sON_90sOFF
frequency: -1.0
intensity: 7.0
max_value: 10.0
Expand Down
24 changes: 12 additions & 12 deletions tests/test_data/nivedita_vr1/opto_nivamasan_10sON90sOFF.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ playlist:
sample_rate: 10000
- Opto1090-9-2:
attenuator: null
filename: 190712_opto_10son_90soff
filename: 190712_opto_10sON_90sOFF
frequency: -1.0
intensity: 9.0
max_value: 10.0
Expand All @@ -49,7 +49,7 @@ playlist:
sample_rate: 10000
- Opto1090-8-2:
attenuator: null
filename: 190712_opto_10son_90soff
filename: 190712_opto_10sON_90sOFF
frequency: -1.0
intensity: 8.0
max_value: 10.0
Expand All @@ -60,7 +60,7 @@ playlist:
sample_rate: 10000
- Opto1090-7-2:
attenuator: null
filename: 190712_opto_10son_90soff
filename: 190712_opto_10sON_90sOFF
frequency: -1.0
intensity: 7.0
max_value: 10.0
Expand All @@ -71,7 +71,7 @@ playlist:
sample_rate: 10000
- Opto1090-9-3:
attenuator: null
filename: 190712_opto_10son_90soff
filename: 190712_opto_10sON_90sOFF
frequency: -1.0
intensity: 9.0
max_value: 10.0
Expand All @@ -82,7 +82,7 @@ playlist:
sample_rate: 10000
- Opto1090-8-3:
attenuator: null
filename: 190712_opto_10son_90soff
filename: 190712_opto_10sON_90sOFF
frequency: -1.0
intensity: 8.0
max_value: 10.0
Expand All @@ -93,7 +93,7 @@ playlist:
sample_rate: 10000
- Opto1090-7-3:
attenuator: null
filename: 190712_opto_10son_90soff
filename: 190712_opto_10sON_90sOFF
frequency: -1.0
intensity: 7.0
max_value: 10.0
Expand All @@ -104,7 +104,7 @@ playlist:
sample_rate: 10000
- Opto1090-9-4:
attenuator: null
filename: 190712_opto_10son_90soff
filename: 190712_opto_10sON_90sOFF
frequency: -1.0
intensity: 9.0
max_value: 10.0
Expand All @@ -115,7 +115,7 @@ playlist:
sample_rate: 10000
- Opto1090-8-4:
attenuator: null
filename: 190712_opto_10son_90soff
filename: 190712_opto_10sON_90sOFF
frequency: -1.0
intensity: 8.0
max_value: 10.0
Expand All @@ -126,7 +126,7 @@ playlist:
sample_rate: 10000
- Opto1090-7-4:
attenuator: null
filename: 190712_opto_10son_90soff
filename: 190712_opto_10sON_90sOFF
frequency: -1.0
intensity: 7.0
max_value: 10.0
Expand All @@ -137,7 +137,7 @@ playlist:
sample_rate: 10000
- Opto1090-9-5:
attenuator: null
filename: 190712_opto_10son_90soff
filename: 190712_opto_10sON_90sOFF
frequency: -1.0
intensity: 9.0
max_value: 10.0
Expand All @@ -148,7 +148,7 @@ playlist:
sample_rate: 10000
- Opto1090-8-5:
attenuator: null
filename: 190712_opto_10son_90soff
filename: 190712_opto_10sON_90sOFF
frequency: -1.0
intensity: 8.0
max_value: 10.0
Expand All @@ -159,7 +159,7 @@ playlist:
sample_rate: 10000
- Opto1090-7-5:
attenuator: null
filename: 190712_opto_10son_90soff
filename: 190712_opto_10sON_90sOFF
frequency: -1.0
intensity: 7.0
max_value: 10.0
Expand Down

0 comments on commit 95a4e9a

Please sign in to comment.