harmonized signatures between methods and lib/grids

This commit is contained in:
2026-06-12 11:43:22 +02:00
parent 86498148ed
commit c8d15dcf1e
2 changed files with 5 additions and 8 deletions
+4 -1
View File
@@ -30,6 +30,7 @@ class aggridx(ui.aggrid):
this operation maintains the current view on the data
"""
row_index = self.row_id_to_index(row_id)
row = {"run": row_id, **row} # setdefault would not force run to be the first column
self.ensure_column_defs(row)
self.set_row_data(row, row_index)
@@ -40,15 +41,17 @@ class aggridx(ui.aggrid):
this operation maintains the current view on the data
"""
row_index = self.row_id_to_index(row_id)
row = {"run": row_id, **row} # setdefault would not force run to be the first column
self.ensure_column_defs(row)
self.update_row_data(row, row_index)
def append_row(self, row):
def append_row(self, row_id, row):
"""
append row to the bottom of the table and
append any missing columns on the right side of the table
this operation maintains the current view on the data
"""
row = {"run": row_id, **row} # setdefault would not force run to be the first column
self.ensure_column_defs(row)
self.extend_row_data([row])
+1 -7
View File
@@ -45,10 +45,8 @@ def append_run(beamline: Beamline, pgroup: PGroup, run: int, entries: dict[str,
lib.append_row(pgroup, run, entries)
entries = {"run": run, **entries} # setdefault would not force run to be the first column
for grid in grids[pgroup]:
grid.append_row(entries)
grid.append_row(run, entries)
@router.put("/pgroups/{pgroup}/runs/{run}")
@@ -63,8 +61,6 @@ def set_run(beamline: Beamline, pgroup: PGroup, run: int, entries: dict[str, Any
lib.set_row(pgroup, run, entries)
entries = {"run": run, **entries} # setdefault would not force run to be the first column
for grid in grids[pgroup]:
grid.set_row(run, entries)
@@ -81,8 +77,6 @@ def update_run(beamline: Beamline, pgroup: PGroup, run: int, entries: dict[str,
lib.update_row(pgroup, run, entries)
entries = {"run": run, **entries} # setdefault would not force run to be the first column
for grid in grids[pgroup]:
grid.update_row(run, entries)