From d5bc62688b9a97f7783baf45e64eb500b3987ce0 Mon Sep 17 00:00:00 2001 From: Integer003 <1204649252@qq.com> Date: Sun, 24 Aug 2025 15:23:17 +0800 Subject: [PATCH] fix(api): correct root experiment and project field names - Fix field name mismatch in experiment summary API - Change rootExperimentId/rootProjectId to rootExpId/rootProId - Correct parameter order in get_summary method --- swanlab/api/experiment.py | 4 ++-- swanlab/api/main.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/swanlab/api/experiment.py b/swanlab/api/experiment.py index 1f91a24eb..ba4983f9f 100644 --- a/swanlab/api/experiment.py +++ b/swanlab/api/experiment.py @@ -125,8 +125,8 @@ def get_summary( "projectId": pro_id, } if root_exp_id and root_pro_id: - data["rootExperimentId"] = root_exp_id - data["rootProjectId"] = root_pro_id + data["rootExpId"] = root_exp_id + data["rootProId"] = root_pro_id resp = self.http.post("/house/metrics/summaries", data=[data], params={}) if resp.errmsg: diff --git a/swanlab/api/main.py b/swanlab/api/main.py index b3b4b8b9f..1029e4ba9 100644 --- a/swanlab/api/main.py +++ b/swanlab/api/main.py @@ -210,8 +210,8 @@ def get_summary( return self.experiment.get_summary( exp_id=exp_id, pro_id=project_cuid, - root_exp_id=exp.data.get("rootProId", ""), - root_pro_id=exp.data.get("rootExpId", "") + root_exp_id=exp.data.get("rootExpId", ""), + root_pro_id=exp.data.get("rootProId", "") ) def get_metrics(