Skip to content

Conversation

snowman2
Copy link
Member

This is the error:

python -m mypy geocube
geocube/rasterize.py:26: error: Incompatible return value type (got "numpy.bool[builtins.bool]", expected "builtins.bool")  [return-value]

The function is using the builtin issubclass method internally.

>>> import numpy
>>> res = numpy.issubdtype("int32", numpy.number)
>>> res
True
>>> type(res)
<class 'bool'>
>>> numpy.bool_(False)
np.False_
>>> type(numpy.bool_(False))
<class 'numpy.bool'>

@snowman2 snowman2 closed this Feb 3, 2025
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