Skip to content

Commit

Permalink
tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
glyg committed Jan 10, 2024
1 parent 5294d3c commit eff6d2c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/tyssue/core/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ class method
"""
with pd.HDFStore(hf5file, "a") as store:

for key, df in self.datasets.items():
kwargs = {"data_columns": ["time"]}
if "segment" in df.columns:
Expand Down Expand Up @@ -328,9 +327,8 @@ def __init__(
)
)
break

with pd.HDFStore(self.hf5file, "r") as file:
self._time_stamps = file.select("vert", columns=["time"])["time"].unique()

self._time_stamps = None

if sheet is None:
last = self.time_stamps[-1]
Expand Down Expand Up @@ -372,6 +370,11 @@ def from_archive(cls, hf5file, columns=None, eptm_class=None):

@property
def time_stamps(self, element="vert"):
if self._time_stamps is None:
with pd.HDFStore(self.hf5file, "r") as file:
self._time_stamps = file.select(element, columns=["time"])[
"time"
].unique()
return self._time_stamps

def record(self, time_stamp=None, sheet=None):
Expand Down

0 comments on commit eff6d2c

Please sign in to comment.