Skip to content

Commit fd19a3d

Browse files
Fix: check profile keys check for backward (pre bgym v0.14.2) compatibility.
1 parent 3dd87c4 commit fd19a3d

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/agentlab/analyze/agent_xray.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,6 +1312,7 @@ def plot_profiling(ax, step_info_list: list[StepInfo], summary_info: dict, progr
13121312
# NEW: Add wait for page loading visualization
13131313
if (
13141314
hasattr(prof, "wait_for_page_loading_start")
1315+
and prof.wait_for_page_loading_start is not None
13151316
and prof.wait_for_page_loading_start > 0
13161317
):
13171318
add_patch(
@@ -1323,7 +1324,11 @@ def plot_profiling(ax, step_info_list: list[StepInfo], summary_info: dict, progr
13231324
)
13241325

13251326
# NEW: Add validation visualization
1326-
if hasattr(prof, "validation_start") and prof.validation_start > 0:
1327+
if (
1328+
hasattr(prof, "validation_start")
1329+
and prof.validation_start is not None
1330+
and prof.validation_start > 0
1331+
):
13271332
add_patch(
13281333
ax,
13291334
prof.validation_start,
@@ -1333,7 +1338,11 @@ def plot_profiling(ax, step_info_list: list[StepInfo], summary_info: dict, progr
13331338
)
13341339

13351340
# NEW: Add get observation visualization
1336-
if hasattr(prof, "get_observation_start") and prof.get_observation_start > 0:
1341+
if (
1342+
hasattr(prof, "get_observation_start")
1343+
and prof.get_observation_start is not None
1344+
and prof.get_observation_start > 0
1345+
):
13371346
add_patch(
13381347
ax,
13391348
prof.get_observation_start,

0 commit comments

Comments
 (0)