Skip to content

fix: new mypy errors due to numpy typing#104

Merged
inducer merged 2 commits into
inducer:mainfrom
alexfikl:fix-mypy
Dec 13, 2024
Merged

fix: new mypy errors due to numpy typing#104
inducer merged 2 commits into
inducer:mainfrom
alexfikl:fix-mypy

Conversation

@alexfikl

@alexfikl alexfikl commented Dec 12, 2024

Copy link
Copy Markdown
Collaborator

I was looking into how to fix the mypy errors from #103. It seems like the issue it's hitting is due to redefinitions, .e.g

x = np.ones(5)
x = x.reshape(-1, 1)

is now a type error because of the different shapes of the arrays. I mostly "fixed" this by forcing the shape to be tuple[int, ...] in all cases, but I imagine there's a nicer way to do it..

@inducer Maybe worth just cherrypicking this into #103 if the mypy test pass, since the ruff tests may still fail.

cc @a-alveyblanc

@inducer

inducer commented Dec 13, 2024

Copy link
Copy Markdown
Owner

Since #103 has another round of review going, I figure we can get this in first. I don't love the numpy typing fixes, but I'm not sure I have a particularly better idea.

@inducer inducer enabled auto-merge (rebase) December 13, 2024 22:22
@inducer inducer merged commit acdc337 into inducer:main Dec 13, 2024
@alexfikl alexfikl deleted the fix-mypy branch December 14, 2024 08:20
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.

3 participants