Skip to content
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

Support type hinting #1559

Open
q-wertz opened this issue Jan 6, 2022 · 5 comments · Fixed by #1677
Open

Support type hinting #1559

q-wertz opened this issue Jan 6, 2022 · 5 comments · Fixed by #1677
Labels
enhancement Feature request or idea about how to make folium better

Comments

@q-wertz
Copy link

q-wertz commented Jan 6, 2022

Is your feature request related to a problem? Please describe.
Currently type hinting is not supported by folium. Are there any plans to implement this?

Describe the solution you'd like
Typing in folium and type hints for the public interfaces (Maybe autogenerated)

Describe alternatives you've considered
Excluding folium in my personal project from type checking by mypy

Additional context
None

Implementation
folium is maintained by volunteers. Can you help make a PR if we want to implement this feature?
-> Can try to help with this

@Conengmo
Copy link
Member

Conengmo commented Jan 6, 2022

Yes, that would be nice. Though type hints in folium are not that useful, since we use a lot of duck-typing. I was working on a change a while back: #1297

@q-wertz
Copy link
Author

q-wertz commented Jan 6, 2022

Ah sorry, didn't see the PR only searched the issues.

Is it not merged due to a certain reason or just not finished?

@Conengmo
Copy link
Member

Conengmo commented Jan 6, 2022

Just not finished. I think we could finish it this time around.

@q-wertz
Copy link
Author

q-wertz commented Jan 6, 2022

If you need testing or something I can help with let me know

@Conengmo Conengmo added the enhancement Feature request or idea about how to make folium better label Nov 17, 2022
@Conengmo Conengmo mentioned this issue Nov 30, 2022
@q-wertz
Copy link
Author

q-wertz commented Nov 6, 2023

After updating folium to 0.15.0 mypy still says:

plots.py:11: error: Skipping analyzing "folium": module is installed, but missing library stubs or py.typed marker  [import-untyped]
plots.py:11: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports

Not a pro in this, but I think you need to add an (empty) py.typed file in the folium folder. (At least mypy stops giving the error message as soon as I add it manually in my venv folium lib...

@Conengmo Conengmo reopened this Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request or idea about how to make folium better
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants