Skip to content

Instantly share code, notes, and snippets.

@joaofig
Created July 12, 2023 15:44
Show Gist options
  • Select an option

  • Save joaofig/deea5edafda99760622e4fd84e75ca07 to your computer and use it in GitHub Desktop.

Select an option

Save joaofig/deea5edafda99760622e4fd84e75ca07 to your computer and use it in GitHub Desktop.
def predict(max_branch: int = 3,
max_length: int = 10) -> FeatureGroup | None:
fg = folium.FeatureGroup(name="polylines")
if "token_list" in st.session_state:
hex_list = st.session_state["token_list"]
seed = hex_list[-3:-1]
if len(seed) > 1:
paths = expand_seed(seed[0], seed[1],
max_branch=max_branch,
max_length=max_length)
for path in paths[:max_branch]:
fg.add_child(path.get_polyline())
return fg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment