- OmeCache bugfix
This commit is contained in:
@@ -152,14 +152,23 @@ class OmeCache(DequeDict):
|
|||||||
def __reduce__(self) -> tuple[type, tuple]:
|
def __reduce__(self) -> tuple[type, tuple]:
|
||||||
return self.__class__, ()
|
return self.__class__, ()
|
||||||
|
|
||||||
def __getitem__(self, path: Path) -> OME:
|
def __getitem__(self, path: Path | str | tuple) -> OME:
|
||||||
return super().__getitem__(self.path_and_lstat(path))
|
if isinstance(path, tuple):
|
||||||
|
return super().__getitem__(path)
|
||||||
|
else:
|
||||||
|
return super().__getitem__(self.path_and_lstat(path))
|
||||||
|
|
||||||
def __setitem__(self, path: Path, value: OME) -> None:
|
def __setitem__(self, path: Path | str | tuple, value: OME) -> None:
|
||||||
super().__setitem__(self.path_and_lstat(path), value)
|
if isinstance(path, tuple):
|
||||||
|
super().__setitem__(path, value)
|
||||||
|
else:
|
||||||
|
super().__setitem__(self.path_and_lstat(path), value)
|
||||||
|
|
||||||
def __contains__(self, path: Path) -> bool:
|
def __contains__(self, path: Path | str | tuple) -> bool:
|
||||||
return super().__contains__(self.path_and_lstat(path))
|
if isinstance(path, tuple):
|
||||||
|
return super().__contains__(path)
|
||||||
|
else:
|
||||||
|
return super().__contains__(self.path_and_lstat(path))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def path_and_lstat(path: str | Path) -> tuple[Path, Optional[os.stat_result], Optional[os.stat_result]]:
|
def path_and_lstat(path: str | Path) -> tuple[Path, Optional[os.stat_result], Optional[os.stat_result]]:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "ndbioimage"
|
name = "ndbioimage"
|
||||||
version = "2024.4.8"
|
version = "2024.5.0"
|
||||||
description = "Bio image reading, metadata and some affine registration."
|
description = "Bio image reading, metadata and some affine registration."
|
||||||
authors = ["W. Pomp <w.pomp@nki.nl>"]
|
authors = ["W. Pomp <w.pomp@nki.nl>"]
|
||||||
license = "GPLv3"
|
license = "GPLv3"
|
||||||
|
|||||||
Reference in New Issue
Block a user