ezmsg-org / ezmsg

Pure-Python DAG-based high-performance SHM-backed pub-sub and multi-processing pattern
https://ezmsg.readthedocs.io/en/latest/
MIT License
15 stars 6 forks source link

Fixes to sigproc.Window #63

Closed cboulay closed 9 months ago

cboulay commented 12 months ago

Note - this is based off #62 and requires #62 to be valid. Of the 4 commits (so far), only the 2nd and 3rd are in question, as the first is from the other PR and the 4th is a cherry-pick from another PR that was already merged into main, but not dev (and I need it in dev).

In this PR, I...

I also noticed that the initialization of the buffer creates a window-length buffer that's all zeros. Then, when new data comes in, the first window out comes only from the initialized zeros! I highly doubt that we want a completely fabricated window as the first window through the pipeline.

I added a new zero_pad_until setting.

griffinmilsap commented 12 months ago

Agreed the zero padding is suboptimal... I really need one-to-one behavior in some of my pipelines (one input results in one output) in order to track completion of processing, so this was the necessary evil. Nans would have been a better choice for padding here, but would likely break the existing filter implementation.

I'm happy to accept this so long as it maintains current behavior as the default. We can deprecate this as a default with a warning.

cboulay commented 10 months ago

I've completely rewritten this, using the generator pattern and adding way more unit tests.

I'll make this a draft for now while I prepare another PR that my new version depends on, then I'll update this PR.

cboulay commented 10 months ago

Note that a457108 is the same commit as in #79 and it might make sense to look at that one first.