Skip to content

fix: update mypy type-ignore code in dem algorithm to [call-overload]#1449

Open
wakame1367 wants to merge 1 commit into
developmentseed:mainfrom
wakame1367:fix/dem-mypy-call-overload
Open

fix: update mypy type-ignore code in dem algorithm to [call-overload]#1449
wakame1367 wants to merge 1 commit into
developmentseed:mainfrom
wakame1367:fix/dem-mypy-call-overload

Conversation

@wakame1367

Copy link
Copy Markdown
Contributor

What

The mypy CI step is currently failing on main (and therefore on every open PR)
because the numpy typing stubs now report the masked-array assignments in the
DEM algorithms as [call-overload] errors instead of [index]:

src/titiler/core/titiler/core/algorithm/dem.py:182: error: No overload variant of "__getitem__" of "generic" matches argument type "int"  [call-overload]
src/titiler/core/titiler/core/algorithm/dem.py:182: note: Error code "call-overload" not covered by "type: ignore[index]" comment

The existing # type: ignore [index] comments no longer cover the reported
error code, so mypy fails.

This PR updates the two ignore comments to [call-overload] to match the code
numpy now emits. No runtime behavior changes.

Changes

  • titiler/core/algorithm/dem.py: # type: ignore [index] -> # type: ignore [call-overload] (lines 182 and 242)

I noticed this while working on #1448 — the failure is unrelated to that PR and
pre-existing on main (e.g. the CI run for the merge commit on main also fails
with the same two dem.py errors).

🤖 Generated with Claude Code

The numpy typing stubs now report the masked-array assignment as a
[call-overload] error instead of [index], leaving the existing
`# type: ignore [index]` comments uncovered and breaking the mypy CI step.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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