added append_data to lib
This commit is contained in:
@@ -48,6 +48,13 @@ class ArcticLibrary:
|
||||
self.lib.update(symbol, df)
|
||||
|
||||
|
||||
def append_data(self, symbol, df):
|
||||
df.index = df.index.view("datetime64[ns]") # adb supports update only for timeseries indexes
|
||||
df.index.name = "run"
|
||||
|
||||
self.lib.append(symbol, df)
|
||||
|
||||
|
||||
def has_index(self, symbol, index):
|
||||
index = encode_index(index)
|
||||
|
||||
|
||||
+2
-5
@@ -30,11 +30,8 @@ def append_run(beamline: Beamline, pgroup: PGroup, run: int, row: dict[str, Any]
|
||||
timestamp = datetime.fromisoformat(timestamp) if timestamp else datetime.now()
|
||||
row = {"timestamp": timestamp, **row} # setdefault would not force timestamp to be the first column
|
||||
|
||||
index = pd.Timestamp(run) # adb supports update only for timeseries indexes
|
||||
index = pd.Index([index], name="run")
|
||||
|
||||
df = pd.DataFrame(row, index=index)
|
||||
lib.append(pgroup, df)
|
||||
df = pd.DataFrame(row, index=[run])
|
||||
lib.append_data(pgroup, df)
|
||||
|
||||
row = {"run": run, **row} # setdefault would not force run to be the first column
|
||||
|
||||
|
||||
Reference in New Issue
Block a user