Skip to content

Fix: complete iterator implementation for arbitrary tile ranges#41

Open
Nityahiray wants to merge 1 commit intoINCF:masterfrom
Nityahiray:patch-2
Open

Fix: complete iterator implementation for arbitrary tile ranges#41
Nityahiray wants to merge 1 commit intoINCF:masterfrom
Nityahiray:patch-2

Conversation

@Nityahiray
Copy link

The Previous iterator had three bugs:
-Used float division (/) instead of integer (//) causing crashes in python3
-Only handled ranges that were exact multiples of M and N (even tiles)
-Variables 'pre'/'post' referenced in except block before assignment if mask was empty

Fixed by rewriting iterator to:
-Start from the tile containing low0/low1 using integer floor division
-Handles partial edge tiles via bounds check (low0 <= gi < high0)
-Remove fragile nested try/except in favour of a simple for loop

Refactor iterator method for improved readability and efficiency.
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