Currently, the Compose class does not apply transforms to empty event arrays. I see that this behavior has been introduced in 4763042 to address #256 .
The problem with this is that first, it's silent. It should at least warn when this happens, because this is behavior is not necessarily expected. Second, it's not always desired. To give a concrete example:
I am slicing my recordings into smaller samples, then use ToFrame to convert the events into frames, along with some other transformations. These transforms are wrapped in Compose. Some of the sliced samples happen to be empty. Normally, ToFrame would simply transform that into a raster of correct shape, with all 0s. However, because the sample is empty, Compose does not apply the transform, and returns the original empty array. Because this is a completely different format than expected subsequent code breaks. Because this happened silently, it was hard to track down the issue.
My suggestion(s) would therefore be:
Change the behavior so that it also applies also the transforms to empty arrays (which is at least intuitive), or at least make it optional.
If keeping the current behavior, at least raise a warning when this happens.
Currently, the
Compose
class does not apply transforms to empty event arrays. I see that this behavior has been introduced in 4763042 to address #256 .The problem with this is that first, it's silent. It should at least warn when this happens, because this is behavior is not necessarily expected. Second, it's not always desired. To give a concrete example:
I am slicing my recordings into smaller samples, then use
ToFrame
to convert the events into frames, along with some other transformations. These transforms are wrapped inCompose
. Some of the sliced samples happen to be empty. Normally,ToFrame
would simply transform that into a raster of correct shape, with all 0s. However, because the sample is empty,Compose
does not apply the transform, and returns the original empty array. Because this is a completely different format than expected subsequent code breaks. Because this happened silently, it was hard to track down the issue.My suggestion(s) would therefore be: