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

fix: ngl_url not passed all places #61

Merged
merged 2 commits into from
Dec 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading