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

Avoid slow session launch #4434

Merged
merged 1 commit into from
May 28, 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
14 changes: 13 additions & 1 deletion fiftyone/core/session/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def __init__(
view_name=final_view_name,
spaces=spaces,
color_scheme=build_color_scheme(color_scheme, dataset, config),
group_slice=(dataset.group_slice if dataset else None),
group_slice=_pull_group_slice(dataset, view),
)
self._client = fosc.Client(
address=address,
Expand Down Expand Up @@ -1317,3 +1317,15 @@ def _on_refresh(session: Session, state: t.Optional[StateDescription]):

if session.dataset is not None:
session.dataset.reload()


def _pull_group_slice(
dataset: t.Optional[fod.Dataset], view: t.Optional[fov.DatasetView]
) -> t.Union[None, str]:
if view is not None:
return view.group_slice

if dataset is not None:
return dataset.group_slice

return None
Loading