aolabNeuro / brain-python-interface

Other
4 stars 2 forks source link

copy parameters from error state doesn’t copy all the features #18

Closed leoscholl closed 3 years ago

leoscholl commented 3 years ago

also if you get an error while testing twice in a row, it won't let you change the parameters any more

leoscholl commented 3 years ago

this was happening because the stale task info from the server was being copied, not any parameters that had been modified by the user. normally this is fine because after the task finishes, the task entry is reloaded from the server to update the report before being copied. on an error, however, you don't want to reload the task entry from the server because (a) that would remove the error state and the error message in the report, and (b) the error might have occured before the task even got saved into the database, in which case you wouldn't have anything to load.

my solution is to reuse the task entry rather than copy it, just resetting the report, notes, idx, etc. this is implemented in 5c2513098b25e1e7ac616268c77d3a0bb3d90c0c