-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Correct type annotations in Realtime #1960
Correct type annotations in Realtime #1960
Conversation
1. Realtime superclass in leaflet is GeoJson (which is a subclass of featuregroup). In Folium I cannot make Realtime a subclass of GeoJson since GeoJson requires features to be present before rendering. I made it a subclass of FeatureGroup to more clearly document that features can be added to a Realtime layer. 2. The container parameter for Realtime cannot just be any `L.Layer`. It must be a `FeatureGroup` or something that allows adding features. I created type annotations to reflect this on the Folium side.
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.
Small comment about updating the docstring, good to go afterwards!
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.
Don't know why that test failed, maybe a hickup and we should try rerunning it? It's approved anyway.
Keep merging things without worrying about that Windows failure. It is a problem with the dependencies in conda-forge and we are working to fix it upstream. |
@@ -1,4 +1,5 @@ | |||
branca>=0.6.0 | |||
fiona |
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.
@hansthen this got merged with this added dependency in the requirements. I don’t think that’s right, since it’s not a required dependency. Could you maybe make a PR to revert this?
This PR corrects a few type annotations for the
Realtime
plugin.Realtime superclass in leaflet is GeoJson (which is a subclass of featuregroup). In Folium I cannot make Realtime a subclass of GeoJson since GeoJson requires features to be present before rendering. I made it a subclass of FeatureGroup to more clearly document that features can be added to a Realtime layer.
The container parameter for Realtime cannot just be any
L.Layer
. It must be aFeatureGroup
or something that allows adding features.I created type annotations to reflect this on the Folium side.