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.Counter #62

Closed cboulay closed 12 months ago

cboulay commented 12 months ago

This PR adds a new set of tests for sigproc.Counter. The tests are pretty thorough and test the generated time axis .offset values as well as the counter values themselves.

In the same commit I modified Counter to sastisfy the unit tests. This required a near total rewrite of the publish method.

I tried for hours to satisfy the unit tests with dispatch_rate="realtime" without using a state variables to keep track of counters and time-since start. I also tried resetting those variables to avoid precision errors as the numbers get very large. In the end, I couldn't succeed, and I left the variables as resetting on startup but never resetting as progress continues.