diff --git a/src/agora/io/cells.py b/src/agora/io/cells.py index d110869142a071d5d3f054b6a1e172b535e297b0..d86b3a13766f410a51a0efb39ed342606843cfaa 100644 --- a/src/agora/io/cells.py +++ b/src/agora/io/cells.py @@ -3,7 +3,7 @@ import typing as t from collections.abc import Iterable from itertools import groupby from pathlib import Path, PosixPath -from functools import lru_cache, cached_property +from functools import lru_cache import h5py import numpy as np @@ -268,7 +268,7 @@ class Cells: def mothers_in_trap(self, trap_id: int): return self.mothers[trap_id] - @cached_property + @property def mothers(self): """ Return nested list with final prediction of mother id for each cell @@ -280,7 +280,7 @@ class Cells: self.ntraps, ) - @cached_property + @property def mothers_daughters(self) -> np.ndarray: """ Return mothers and daugters as a single array with three columns: diff --git a/src/agora/io/signal.py b/src/agora/io/signal.py index 489a52563d352f62f0d40a1624f5b435c4428210..ca1858aba718eb49ba50b28b20d8eeecd83d99cc 100644 --- a/src/agora/io/signal.py +++ b/src/agora/io/signal.py @@ -1,6 +1,7 @@ import typing as t from copy import copy -from functools import cached_property, lru_cache +#from functools import cached_property, lru_cache +from functools import lru_cache from pathlib import PosixPath import bottleneck as bn @@ -77,12 +78,12 @@ class Signal(BridgeH5): ) return df - @cached_property + @property def ntimepoints(self): with h5py.File(self.filename, "r") as f: return f["extraction/general/None/area/timepoint"][-1] + 1 - @cached_property + @property def tinterval(self) -> int: tinterval_location = "time_settings/timeinterval" with h5py.File(self.filename, "r") as f: @@ -214,12 +215,12 @@ class Signal(BridgeH5): for sig in self.siglist: print(sig) - @cached_property + @property def p_available(self): """Print signal list""" self.datasets - @cached_property + @property def available(self): """Return list of available signals""" try: @@ -237,17 +238,17 @@ class Signal(BridgeH5): def get_merged(self, dataset): return self.apply_prepost(dataset, picks=False) - @cached_property + @property def merges(self): with h5py.File(self.filename, "r") as f: dsets = f.visititems(self._if_merges) return dsets - @cached_property + @property def n_merges(self): return len(self.merges) - @cached_property + @property def picks(self): with h5py.File(self.filename, "r") as f: dsets = f.visititems(self._if_picks) diff --git a/src/aliby/pipeline.py b/src/aliby/pipeline.py index 00f50a38df83f31b325b91a8dd5f4e24f017c77d..71e066f5f52c700ac3ebab21933d28c3d4255dd8 100644 --- a/src/aliby/pipeline.py +++ b/src/aliby/pipeline.py @@ -7,7 +7,11 @@ import re import traceback import typing as t from copy import copy -from importlib.metadata import version +try: + from importlib.metadata import version +except ImportError: + # for python < 3.8 + from importlib_metadata import version from pathlib import Path, PosixPath from time import perf_counter from typing import Union @@ -597,7 +601,7 @@ class Pipeline(ProcessABC): ]: """ Initialise pipeline components and if necessary use - exising file to continue existing experiments. + existing file to continue existing experiments. Parameters