-
Notifications
You must be signed in to change notification settings - Fork 68
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
Add type hints #146
Add type hints #146
Conversation
@ocefpaf would you mind taking a look at this PR at some time? No hurry. I know it's pretty big, but I don't know how to do it otherwise, it's just a lot of type hints. I'm open to suggestions! I'm asking you since you also did python-visualization/folium#1677. |
Sure. I don't have a lot of experience but we can try to run mypy here to check things? I'll see what we can do. There are also some pre-commits that can help. PS: we need to fix a conflict but I'm looking at it now. |
- name: Mypy test | ||
shell: bash -l {0} | ||
run: | | ||
mypy branca |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ha! You are always one (many actually) step ahead of me.
Thanks Filipe, much appreciated! I’ll solve the merge conflict before merging. Good idea to add a precommit config as well, I’ll do that in a separate PR. |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Contains some (internally) functional changes as well:
_parse_hex
to output RGBA floats directly. We only use that function inside of_parse_color
, which needs RGBA floats as output.bytes
as accepted type for color strings. That's a remnant from the Python 2 times.Do separately later:
Figure
use the same types for width and height. Also a separate PR I think. Would be easiest to have_parse_size
just return a single string._camelify
function. Is it even needed?get_templates