cortex-lab / Rigbox

A MATLAB toolbox for running behavioral neuroscience experiments and managing data
GNU General Public License v3.0
33 stars 16 forks source link

Flattened struct signals update without all inputs #275

Open k1o0 opened 4 years ago

k1o0 commented 4 years ago

Describe the bug Signals run through flattenStruct update even if some of their inputs have no value yet. This led to catastrophic crashes in Signals that I patched with https://github.com/cortex-lab/signals/commit/276cd6f45a3ffa426f6a722b08fe86bd473aa30d, however it should be fixed in the MEX code so that performance isn't affected.

To Reproduce The problem was described in issue #44, however with the current fix we no longer have crashes.

Expected behavior A flattenStruct Signal shouldn't update until its input fields have all updated with a value.

Additional context This should be fixed in mexnet here (c.f. old code). This will require recompiling the MEX code. Whoever does this should document the process thoroughly so that others can also do it. Also there should be tests written for this code, particularly where it's been changed.