Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an example of accessing sliding windows of data with channel operations. This example is rudimentary and not ideal because all data must be read in at once. A better example would allow more of a data streaming mechanism, but I'm not sure how best to do that with the current channel API. I think to do this properly you would need some sort of
peek()
mechanism.If I don't have the
peek()
mechanism, if the sliding window is in anscf.for
, I believe the only options are to put nestedif/else
(which I haven't yet ever used, but should be inmlir-python-extras
) statements or anscf.index_switch
(which is not inmlir-python-extras
) with one statement per unique window in the loop... which is not a scalable way to write this sort of code.I made this example along the way towards working on a large example, and I thought it was a useful building block, so that is why I am adding it to the programming examples (even with the sub-optimal implementation). I'm very open to suggestions for how to make it better!