diff --git a/stand/api.py b/stand/api.py index abb0acd..36ae4bc 100644 --- a/stand/api.py +++ b/stand/api.py @@ -27,16 +27,16 @@ def clear_pgroup(beamline: Beamline, pgroup: PGroup): @router.post("/pgroups/{pgroup}/runs/{run}") -def append_run(beamline: Beamline, pgroup: PGroup, run: int, row: dict[str, Any]): +def append_run(beamline: Beamline, pgroup: PGroup, run: int, entries: dict[str, Any]): lib = adb.get(beamline) run_exists = lib.has_index(pgroup, run) if run_exists: raise HTTPException(HTTPStatus.CONFLICT, f"run {run} exists already in {beamline}/{pgroup}") - timestamp = row.pop("timestamp", None) + timestamp = entries.pop("timestamp", None) timestamp = datetime.fromisoformat(timestamp) if timestamp else datetime.now() - row = {"timestamp": timestamp, **row} # setdefault would not force timestamp to be the first column + row = {"timestamp": timestamp, **entries} # setdefault would not force timestamp to be the first column df = pd.DataFrame(row, index=[run]) lib.append_data(pgroup, df)