Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR supersedes #66. Refer to that PR for background.
The approach in the previous PR satisfied Pylance but ran into issues with Mypy. This PR instead tries to resolve the issue by including a typing stub (.pyi) file that exposes the Raster class for static analysis tools like Pylance and Mypy without affecting the runtime behavior.
The new approach seems to work well, except Mypy now complains about the new stub file conflicting with the existing .py file:
This seems to be related to the way that pre-commit passes arguments to Mypy. When running Mypy on a directory containing both .py and .pyi files, it runs fine. But when passing individual .py and .pyi files with identical module names as separate arguments to Mypy (as pre-commit does) it raises the above error.
Since this issue is largely related to the particular way that pre-commit runs Mypy, I think a reasonable bandaid is to simply exclude the conflicting .py file from the pre-commit hook.
Closes #66