Conversation
| def to_array(self) -> tuple[np.ndarray, np.ndarray]: | ||
| indices = (self._start + np.arange(self._size)) % self._max_length | ||
| return self._buffer[indices], self._timestamp[indices] |
There was a problem hiding this comment.
Here the code always returns a copy of the array because when the window is full, new data are written at the beginning of the arrays and the values must be reordered.
Returning a view of the array would be more memory efficient, but I haven't found a better way to implement the FIFO logic without wrapping the values
sanketsabharwal
left a comment
There was a problem hiding this comment.
hi @nicola-corbellini have shared comments - will be helpful if they can be addressed.
| # Add project root to import path | ||
| if os.getcwd() not in sys.path: | ||
| sys.path.append(os.getcwd()) | ||
| sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) |
There was a problem hiding this comment.
This is redundant. Not required.
There was a problem hiding this comment.
Yep I know but it doesn't work on my machine without it. Don't understand why
|
Hi @sanketsabharwal, addressed all the changes. For the moment I left the Also, I have the doubt that type checking in the |
sanketsabharwal
left a comment
There was a problem hiding this comment.
ok tested it! works find now. about the part concerning sys, i'll figure it out when we meet next. i'll write to separately on WA to decide when we can meet for the .toe integration.
This solves #6
I've also refactored
SmoothnessandSynchronizationand related examples to use the new implemented class with the idea to show usage examples.I'm not sure my usage is the best one, so we can discuss other options. Eventually, I can revert those changes and merge only the
sliding_window.pyfile