Skip to content

Conversation

@jack-dunham
Copy link
Contributor

Description

Checking of islaststep is now skipped for the first iteration. This fixes a bug where length 1 iterators don't iterate at all and thus don't execute their only call to compute!.
Skipping islaststep check for the initial iterations makes sense as the interface of AbstractNetworkIterator assumes an implicit "move to first state" at construction.

This also means that constructing a AbstractNetworkIterator is basically undefined as there is in that case there is no first state to move to. As such, constructing SweepIterator and RegionIterator now throws an error if if empty iterators are passed.

I have added some tests for these edge cases; all other tests pass.

Jack Dunham added 3 commits October 28, 2025 10:37
…ives `BoundsError`.

Constructing `RegionIterator` of length 0 is now undefined.

Adjust region iterator `BoundsError` message to align with
`SweepIterator`.
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