diff --git a/pyproject.toml b/pyproject.toml index 2261a1e..145679d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "polystore" -version = "0.1.25" +version = "0.1.26" description = "Framework-agnostic multi-backend storage abstraction for ML and scientific computing" readme = "README.md" requires-python = ">=3.11" diff --git a/src/polystore/zarr.py b/src/polystore/zarr.py index 848d2bf..26e82d8 100644 --- a/src/polystore/zarr.py +++ b/src/polystore/zarr.py @@ -105,6 +105,7 @@ def _ensure_ome_zarr(timeout: float = 30.0): from .constants import Backend from .base import PicklableBackend, StorageBackend +from .config import ZarrConfig from .exceptions import StorageResolutionError @@ -137,9 +138,6 @@ def __init__(self, zarr_config: Optional['ZarrConfig'] = None): Args: zarr_config: ZarrConfig dataclass with all zarr settings (uses defaults if None) """ - # Import here to avoid circular imports - from .config import ZarrConfig - if zarr_config is None: zarr_config = ZarrConfig() @@ -157,8 +155,6 @@ def get_connection_params(self) -> Optional[Dict[str, Any]]: return {"zarr_config": self.config} def set_connection_params(self, params: Optional[Dict[str, Any]]) -> None: - from .config import ZarrConfig - if params is None: self._configure(ZarrConfig()) return diff --git a/tests/test_zarr_backend.py b/tests/test_zarr_backend.py index 2ae239f..e1a4bbb 100644 --- a/tests/test_zarr_backend.py +++ b/tests/test_zarr_backend.py @@ -17,6 +17,7 @@ from dataclasses import fields from inspect import getdoc from pathlib import Path +from typing import get_type_hints import numpy as np import pytest @@ -250,6 +251,11 @@ def test_save_to_nonexistent_parent_creates_parent(self, zarr_backend, temp_zarr class TestZarrConfigIntegration: """Test ZarrConfig integration with backend.""" + def test_backend_config_annotation_resolves_to_nominal_owner(self): + hints = get_type_hints(ZarrStorageBackend._configure) + + assert hints["zarr_config"] is ZarrConfig + def test_public_fields_have_declaration_help(self): docstring = getdoc(ZarrConfig)