DRAFT
When an App is registered on Brainlife, a config.json
is automatically created based on the info the App creator enter via the GUI. There are four types of parameters:
NUMBER
STRING
ENUM
BOOL
So, it is impossible to enter a list of int
or a numpy nd.array
for instance. So the values must be converted.
For now, we have decided not to read and convert Python dictionary, so the BL user won’t be able to give a dictionary as a parameter value.
Case of a numpy.nd.array
It is impossible to enter a np.nd.array
in BL. So we register such parameter as a STRING
and ask the user to enter floats separated by a comma: 10, 15, 20. In the config.json
, such parameter will be written as:
{ "param_notch_widths": "10, 15, 20" }
It was decided to enter numpy.nd.array
this way on BL to differentiate it from the way it was entered in the config.json.example
when the App is run locally (see Parameters conversion).
In the Python file, we added:
if isinstance(config['param_notch_widths'], str): config['param_notch_widths'] = list(map(float, config['param_notch_widths'].split(', '))) config['param_notch_widths'] = np.array(config['param_notch_widths'])
0 Comments