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

vector layers: allow both snake_case and lowerCamelCase options #1672

Conversation

Conengmo
Copy link
Member

@Conengmo Conengmo commented Nov 29, 2022

Closes #1452

In folium we use PEP8, which means function arguments and variables are in snake_case notation. This can be confusing when users look up path options from Leaflet for vector type layers, which use lowerCamelCase notation. We refer to these options in multiple places, for example here:

Other valid (possibly inherited) options. See:
https://leafletjs.com/reference.html#polyline

Address this by allowing both snake_case as lowerCamelCase notation for vector path options. Implement this by converting the function arguments directly to lowerCamelCase within the path_options function. This way, both notation styles are merged into one: lowerCamelCase. Which is also the notation used in the output of this function.

Note that the parse_options function we use in other places already has this dual behavior currently.

Since we are sticking with PEP8 we don't have to broadcast this in every piece of documentation, but it should prevent more issue reports on this topic.

@Conengmo Conengmo merged commit ba30a45 into python-visualization:main Nov 29, 2022
@Conengmo Conengmo deleted the vector-layers-snake-case-and-camel-case branch November 29, 2022 15:59
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.

Vector path options don't accept camelCase
2 participants