We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2c7d373 commit a09d212Copy full SHA for a09d212
CPAC/nuisance/utils/compcor.py
@@ -198,17 +198,13 @@ def TR_string_to_float(tr):
198
raise TypeError(f'Improper type for TR_string_to_float ({tr}).')
199
200
tr_str = tr.replace(' ', '')
201
- factor = 1.
202
-
203
- if tr_str.endswith('ms'):
204
- tr_str = tr_str[:-2]
205
- factor = 0.001
206
- elif tr.endswith('s'):
207
- tr_str = tr_str[:-1]
208
209
try:
210
- tr_numeric = float(tr_str)
+ if tr_str.endswith('ms'):
+ tr_numeric = float(tr_str[:-2]) * 0.001
+ elif tr.endswith('s'):
+ tr_numeric = float(tr_str[:-1])
211
except Exception as exc:
212
raise ValueError(f'Can not convert TR string to float: "{tr}".') from exc
213
214
- return tr_numeric * factor
+ return tr_numeric
0 commit comments