Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Status
colourRed
titledraft

Although an App runs smoothly locally, when you try to run it on BL errors can occur. Here are the errors I came across and the way I solved them.

None Null value of an optional parameter

...

Code Block
"param_st_duration": "",

Then the this value of this parameter is passed to the MNE function maxfilter, which reads it as a string instead of None and an error is raised .because the function expects a float or None:

Code Block
ValueError: could not convert string to float

So, to circumvent this issue, I had in add to my Python file the lines:

Code Block
if config['param_st_duration'] == "":
    param_st_duration = None
else:
    param_st_duration = config['param_st_duration']

...

When it is possible, instead of registering an optional parameter as optional in BL, define it in as an ENUM parameter and let the user choose between the fixed values of the parameter of Noneor an empty field, don’t propose None because in the config.json it will be written as:

Code Block
"param_regularize": "None"

instead of null.