ezmsg-org / ezmsg-sigproc

Timeseries signal processing implementations for ezmsg
MIT License
0 stars 0 forks source link

More thorough signal processing state-reset upon changing inputs #21

Closed cboulay closed 1 month ago

cboulay commented 2 months ago

Some sigproc generators will reset their state when the incoming sample rate or array shape have changed, because the state (e.g. filter coefficients) depend on these variables.

AxisArray now has .key which can also be used to trigger a reset.

Here is a list of stateful processors and the changes they need:

Note 1: Even with the above fixes, many of the above will still crash if the axis order is permuted. Most cases will be handled by shape checking.

Note 2: I'll do my best to package the comparison variables into a dict or similar. In the future, if we want, we can nest the comparison variables and the state into a keyed-dict and do a per-key state. i.e., b_reset = b_reset or in_msg.key != check["key"] becomes b_reset = b_reset or in_msg.key not in check.

cboulay commented 2 months ago

While I'm at it, I'll also check that size-zero arrays are handled well.