Skip to content
Snippets Groups Projects
Commit 1da4264f authored by Toumji Abdallah's avatar Toumji Abdallah
Browse files

Handled exception in the testing of float values and some column positions values

parent b78b144d
Branches
No related tags found
No related merge requests found
......@@ -16,7 +16,10 @@ def text_to_condition(string, value):
"""
result = "(" + string + ")"
result = result.replace(';', 'and')
try:
return eval(result)
except (ValueError, SyntaxError):
return False
def create_entry_from_json(form, frame, help_icon):
......
......@@ -3,17 +3,20 @@
"name": {
"requirement level": "required",
"description": "Label of the channel, values must be unique",
"valid condition": "len(str(value)) > 0"
"valid condition": "len(str(value)) > 0",
"position": 1
},
"type": {
"requirement level": "required",
"description": "Type of the channel",
"valid condition": "len(str(value)) > 0"
"valid condition": "len(str(value)) > 0",
"position": 2
},
"units": {
"requirement level": "required",
"description": "Physical unit of the value represented in this channel, for example, V for Volt, or fT/cm for femto Tesla per centimeter",
"valid condition": "len(str(value)) > 0"
"valid condition": "len(str(value)) > 0",
"position": 3
},
"description": {
"requirement level": "optional",
......@@ -678,14 +681,16 @@
"description": "Onset (in seconds) of the event, measured from the beginning of the acquisition of the first data point stored in the corresponding task data file. Negative onsets are allowed, to account for events that occur prior to the first stored data point. For example, in case there is an in-scanner training phase that begins before the scanning sequence has started events from this sequence should have negative onset time counting down to the beginning of the acquisition of the first volume. If any data points have been discarded before forming the data file (for example, 'dummy volumes' in BOLD fMRI), a time of 0 corresponds to the first stored data point and not the first acquired data point.",
"valid condition": "float(value)>=0",
"multiple": false,
"modulable": false
"modulable": false,
"position": 1
},
"duration": {
"requirement level": "required",
"description": "Duration of the event (measured from onset) in seconds. Must always be either zero or positive (or 'n/a' if unavailable). A 'duration' value of zero implies that the delta function or event is so short as to be effectively modeled as an impulse.",
"valid condition": "value == 'n/a' or float(value)>=0",
"multiple": false,
"modulable": false
"modulable": false,
"position": 2
},
"trial_type": {
"requirement level": "optional",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment