Skip to content

Commit

Permalink
Merge pull request #61 from CAVEconnectome/fix--ngl_url-not-in-make_s…
Browse files Browse the repository at this point in the history
…tate_url

fix: ngl_url not passed all places
  • Loading branch information
ceesem authored Dec 11, 2024
2 parents 0a4c37c + efdfb7a commit 7ba0d91
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/nglui/statebuilder/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,12 @@ def make_state_url(
Url to the uploaded neuroglancer state.
"""
state = sb.render_state(
df, return_as="dict", target_site=target_site, config_key=config_key
df,
return_as="dict",
url_prefix=ngl_url,
client=client,
target_site=target_site,
config_key=config_key,
)
state_id = client.state.upload_state_json(state)
if ngl_url is None:
Expand All @@ -402,7 +407,7 @@ def make_url_robust(
df: pd.DataFrame,
sb: StateBuilder,
client: CAVEclient,
shorten: str = "if_long",
shorten: Literal["if_long", "always", "never"] = "if_long",
ngl_url: str = None,
max_url_length=MAX_URL_LENGTH,
target_site=None,
Expand Down Expand Up @@ -433,6 +438,8 @@ def make_url_robust(
Type of neuroglancer deployment to build link for, by default None.
This value overrides automatic checking based on the provided url.
Use `seunglab` for a Seung-lab branch and either `mainline` or `cave-explorer` for the Cave Explorer or main Google branch.
config_key : str
Which site config you want to use.
Returns
-------
Expand Down Expand Up @@ -512,7 +519,7 @@ def package_state(
HTML, str or dict
state in format specified by return_as
"""
if (return_as == "html") or (return_as == "url") or (return_as == "short"):
if return_as in ["html", "url", "short"]:
if return_as == "short":
return_as = "url"
shorten = "always"
Expand Down

0 comments on commit 7ba0d91

Please sign in to comment.