Skip to content

Commit

Permalink
Bug fix in relative path handling for fcs file autofinding
Browse files Browse the repository at this point in the history
Signed-off-by: Hersh Bhargava <hershkbhargava@gmail.com>
  • Loading branch information
hbhargava7 committed Sep 4, 2023
1 parent c9be7fb commit b314cd6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion flowkit/_models/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from bokeh.models import Title
from urllib.parse import urlparse, unquote
from urllib.request import url2pathname
from pathlib import Path
from .._conf import debug
from .._models import gates, dimension
from .._utils import plot_utils, wsp_utils, sample_utils, gating_utils
Expand Down Expand Up @@ -81,10 +82,13 @@ def uri_to_path(uri):

path = unquote(parsed.path)

# if the path is relative, join it with the wsp file's directory
if os.path.isabs(path):
return path
else:
return os.path.join(os.getcwd(), path)
# The relative path is relative to the wsp file's directory, so prepend that.
base_path = os.path.dirname(os.path.abspath(Path(wsp_file_path)))
return os.path.join(base_path, path)

if fcs_samples is not None:
warnings.warn("When `find_fcs_files_from_wsp` is True, `fcs_samples` will be ignored.")
Expand Down

0 comments on commit b314cd6

Please sign in to comment.