Skip to content

Fix multiprocessing_apply crash on empty sequences with n_workers > 1#312

Merged
JoOkuma merged 1 commit into
royerlab:mainfrom
JoOkuma:fix-mp-apply-empty-sequence
Jul 1, 2026
Merged

Fix multiprocessing_apply crash on empty sequences with n_workers > 1#312
JoOkuma merged 1 commit into
royerlab:mainfrom
JoOkuma:fix-mp-apply-empty-sequence

Conversation

@JoOkuma

@JoOkuma JoOkuma commented Jul 1, 2026

Copy link
Copy Markdown
Member

multiprocessing_apply reached Pool(0) for empty sequences when n_workers > 1, raising ValueError. Reachable from any operator on a graph without time points when parallelism is enabled.

Return early for empty input.

Added tests for empty and non-empty sequences with 1 and 2 workers.

With an empty sequence and n_workers > 1, multiprocessing_apply reached
Pool(min(n_workers, 0)) and raised 'ValueError: Number of processes
must be at least 1'. This is reachable from any operator applied to a
graph without time points (e.g. edges operators on an empty graph) when
parallelism is enabled.

Return early for empty input instead.
@JoOkuma JoOkuma merged commit 4ad2973 into royerlab:main Jul 1, 2026
5 checks passed
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

Successfully merging this pull request may close these issues.

1 participant