Skip to content

Commit 2e28f2e

Browse files
committed
Add warnings for Windows timeouts and clarify parallel backend options; update get_results method to conditionally save outputs
1 parent e910ae3 commit 2e28f2e

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

src/agentlab/experiments/exp_utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ def timeout_manager(seconds: int = None):
5050
"""Context manager to handle timeouts."""
5151
if seconds is None or sys.platform == "win32":
5252
try:
53+
logger.warning("Timeouts are not supported on Windows.")
5354
yield
5455
finally:
5556
pass

src/agentlab/experiments/launch_exp.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ def run_experiments(
2727
exp_dir: Path
2828
Directory where the experiments will be saved.
2929
parallel_backend: str
30-
Parallel backend to use. Either "joblib", "dask" or "sequential".
30+
Parallel backend to use. Either "joblib", "ray" or "sequential".
31+
The only backend that supports webarena graph dependencies correctly is ray or sequential.
3132
avg_step_timeout: int
3233
Will raise a TimeoutError if the episode is not finished after env_args.max_steps * avg_step_timeout seconds.
3334
"""
@@ -51,7 +52,8 @@ def run_experiments(
5152
if parallel_backend == "joblib":
5253
from joblib import Parallel, delayed
5354

54-
# split sequential
55+
56+
# split sequential (should be no longer needed with dependencies)
5557
sequential_exp_args, exp_args_list = _split_sequential_exp(exp_args_list)
5658

5759
logging.info(

src/agentlab/experiments/study.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ def run(
138138

139139
suffix = f"trial_{i + 1}_of_{n_relaunch}"
140140
_, summary_df, error_report = self.get_results(suffix=suffix)
141-
logger.info("\n" + error_report)
142141
logger.info("\n" + str(summary_df))
143142

144143
n_incomplete, n_error = self.find_incomplete(include_errors=relaunch_errors)
@@ -202,15 +201,16 @@ def append_to_journal(self, strict_reproducibility=True):
202201
strict_reproducibility=strict_reproducibility,
203202
)
204203

205-
def get_results(self, suffix=""):
204+
def get_results(self, suffix="", also_save=True):
206205
result_df = inspect_results.load_result_df(self.dir)
207206
error_report = inspect_results.error_report(result_df, max_stack_trace=3, use_log=True)
208207
summary_df = inspect_results.summarize_study(result_df)
209208

210-
suffix = f"_{suffix}" if suffix else ""
211-
result_df.to_csv(self.dir / f"result_df{suffix}.csv")
212-
summary_df.to_csv(self.dir / f"summary_df{suffix}.csv")
213-
(self.dir / f"error_report{suffix}.md").write_text(error_report)
209+
if also_save:
210+
suffix = f"_{suffix}" if suffix else ""
211+
result_df.to_csv(self.dir / f"result_df{suffix}.csv")
212+
summary_df.to_csv(self.dir / f"summary_df{suffix}.csv")
213+
(self.dir / f"error_report{suffix}.md").write_text(error_report)
214214

215215
return result_df, summary_df, error_report
216216

0 commit comments

Comments
 (0)