added set_data to lib
This commit is contained in:
@@ -41,6 +41,11 @@ class ArcticLibrary:
|
||||
return df
|
||||
|
||||
|
||||
def set_data(self, symbol, df):
|
||||
df.index = df.index.view("datetime64[ns]") # adb supports update only for timeseries indexes
|
||||
self.lib.update(symbol, df)
|
||||
|
||||
|
||||
def has_index(self, symbol, index):
|
||||
index = encode_index(index)
|
||||
|
||||
|
||||
+3
-3
@@ -85,11 +85,11 @@ def update_adb(evt):
|
||||
col_id = evt.args["colId"]
|
||||
new_val = evt.args["newValue"]
|
||||
|
||||
index = pd.Timestamp(int(row_id)) # adb supports update only for timeseries indexes
|
||||
index = int(row_id)
|
||||
lib = adb.get(beamline)
|
||||
df = lib.read(pgroup, date_range=[index]).data
|
||||
df = lib.get_data(pgroup, index)
|
||||
df.at[index, col_id] = new_val
|
||||
lib.update(pgroup, df)
|
||||
lib.set_data(pgroup, df)
|
||||
|
||||
|
||||
def update_grids(evt):
|
||||
|
||||
Reference in New Issue
Block a user