Skip to content
Merged
Show file tree
Hide file tree
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
31 changes: 0 additions & 31 deletions docs/source/input_preparation_installed_20261001.rst

This file was deleted.

32 changes: 0 additions & 32 deletions docs/source/input_preparation_parent_20261001.rst

This file was deleted.

108 changes: 0 additions & 108 deletions docs/source/metadata_namespace_327.rst

This file was deleted.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "polystore"
version = "0.6.0"
version = "0.6.1"
description = "Framework-agnostic multi-backend storage abstraction for ML and scientific computing"
readme = "README.md"
requires-python = ">=3.11"
Expand Down
12 changes: 12 additions & 0 deletions src/polystore/omero_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -1130,6 +1130,18 @@ def exists(self, path: str | Path) -> bool:
except (ValueError, IndexError):
return False

def is_dir(self, path: str | Path) -> bool:
"""A valid OMERO path without a file suffix names a virtual directory.

Plates and their derived output groups are directories; planes and
tables are files named with their format's suffix.
"""
return self.exists(path) and not PurePosixPath(str(path).replace("\\", "/")).suffix

def is_file(self, path: str | Path) -> bool:
"""A valid OMERO path with a file suffix names a virtual file."""
return self.exists(path) and bool(PurePosixPath(str(path).replace("\\", "/")).suffix)

def ensure_directory(self, directory: str | Path) -> None:
"""
Ensure directory exists (no-op for OMERO virtual backend).
Expand Down
26 changes: 26 additions & 0 deletions tests/test_omero_virtual_paths.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"""OMERO virtual paths answer the storage directory and file queries."""

import pytest

from polystore.omero_local import OMEROLocalBackend


@pytest.mark.parametrize(
("path", "is_dir", "is_file"),
(
("/omero/plate_1", True, False),
("/omero/plate_1_outputs/images", True, False),
("/omero/plate_1_outputs/images/A01_s001_w1_z001_t001.tif", False, True),
("/omero/plate_1_outputs/images_results/A01_measurements.csv", False, True),
("/data/plate_1", False, False),
("/omero/not_a_plate", False, False),
),
)
def test_omero_paths_are_directories_unless_they_name_a_file(
path: str, is_dir: bool, is_file: bool
) -> None:
# The path queries need no server connection.
backend = object.__new__(OMEROLocalBackend)

assert backend.is_dir(path) is is_dir
assert backend.is_file(path) is is_file
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading