Skip to content

Commit

Permalink
fix(core): dataset path does not overflow select dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulHax committed Oct 7, 2024
1 parent 80100f0 commit 98c05a6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/nrtk_explorer/app/core.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import logging
from typing import Iterable
from pathlib import Path

from trame.widgets import html
from trame_server.utils.namespace import Translator
Expand Down Expand Up @@ -51,7 +50,7 @@ def __init__(self, server=None):

known_args, _ = self.server.cli.parse_known_args()
self.input_paths = known_args.dataset
self.state.current_dataset = str(Path(self.input_paths[0]).resolve())
self.state.current_dataset = self.input_paths[0]

self.ctrl.get_image_fpath = lambda i: get_image_fpath(i, self.state.current_dataset)
images = Images(server=self.server)
Expand Down
4 changes: 2 additions & 2 deletions src/nrtk_explorer/app/embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __init__(
self.is_standalone_app = self.server.root_server == self.server
if self.is_standalone_app and datasets:
self.state.dataset_ids = []
self.state.current_dataset = str(Path(datasets[0]).resolve())
self.state.current_dataset = datasets[0]
self.on_current_dataset_change()

self.features = None
Expand Down Expand Up @@ -351,7 +351,7 @@ def ui(self):
options=(
"dataset_options",
[
{"label": Path(p).name, "value": str(Path(p).resolve())}
{"label": Path(p).name, "value": p}
for p in self._dataset_paths
],
),
Expand Down
3 changes: 2 additions & 1 deletion src/nrtk_explorer/library/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ def get_dataset(path: str, force_reload: bool = False):
"""
if force_reload:
__load_dataset.cache_clear()
return __load_dataset(path)
absolute_path = str(Path(path).resolve())
return __load_dataset(absolute_path)


def get_image_fpath(selected_id: int, path: str):
Expand Down

0 comments on commit 98c05a6

Please sign in to comment.