Skip to content

Commit

Permalink
Merge pull request #4434 from voxel51/bugfix/session-group-slice
Browse files Browse the repository at this point in the history
Avoid slow session launch
  • Loading branch information
brimoor authored May 28, 2024
2 parents e983f0e + ec8d594 commit 1a8e2ba
Showing 1 changed file with 13 additions and 1 deletion.
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

0 comments on commit 1a8e2ba

Please sign in to comment.