+
Skip to content

Fix types mypy #616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Fix types mypy #616

wants to merge 5 commits into from

Conversation

alessiamarcolini
Copy link
Collaborator

@alessiamarcolini alessiamarcolini commented Aug 17, 2023

sibling of #380

This PR attemps to fix some of (or all) the typing issues found by running mypy histolab.

Unfortunately some of these issues are hard to fix without context and without making a design decision. I've left a couple of TODOs in the code for that.

The biggest issue is having class Filter(Protocol) that has a call method that accepts either an image or a ndarray, unfortunaly mypy doesn't allow to change the argument type to a more specific one (see https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides). Maybe we should have two types of Filters, one for images and one for ndarrays.

Also, I'm not 100% convinced Protocol is useful here (and in the Tiler class), what's the reasoning behind using Protocol and not abc.ABC?

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.

2 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载