Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poor handling of empty data in Compose #292

Open
bauerfe opened this issue Aug 28, 2024 · 0 comments
Open

Poor handling of empty data in Compose #292

bauerfe opened this issue Aug 28, 2024 · 0 comments

Comments

@bauerfe
Copy link
Collaborator

bauerfe commented Aug 28, 2024

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:

  1. 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.
  2. If keeping the current behavior, at least raise a warning when this happens.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant