Skip to content
Snippets Groups Projects
Commit 61b2a2c3 authored by pswain's avatar pswain
Browse files

changed @cached_property to @property to run in 3.7

parent 57252253
Branches dev_python3_7
No related tags found
No related merge requests found
......@@ -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:
......
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)
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment