Skip to content

Commit

Permalink
Merge pull request #200 from ServiceNow/mass_patch_1
Browse files Browse the repository at this point in the history
small API change - passing exp_root to study.run()
  • Loading branch information
recursix authored Jan 13, 2025
2 parents 6d2b1ea + 53a395c commit e6c19be
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/agentlab/experiments/study.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,12 +298,13 @@ def run(
strict_reproducibility=False,
n_relaunch=3,
relaunch_errors=True,
exp_root=RESULTS_DIR,
):

self.set_reproducibility_info(
strict_reproducibility=strict_reproducibility, comment=self.comment
)
self.save()
self.save(exp_root=exp_root)

n_exp = len(self.exp_args_list)
last_error_count = None
Expand Down Expand Up @@ -461,15 +462,22 @@ def find_incomplete(self, include_errors=True):
for study in self.studies:
study.find_incomplete(include_errors=include_errors)

def run(self, n_jobs=1, parallel_backend="ray", strict_reproducibility=False, n_relaunch=3):
def run(
self,
n_jobs=1,
parallel_backend="ray",
strict_reproducibility=False,
n_relaunch=3,
exp_root=RESULTS_DIR,
):

# This sequence of of making directories is important to make sure objects are materialized
# properly before saving. Otherwise relaunch may not work properly.
self.make_dir()
for study in self.studies:
study.make_dir(exp_root=self.dir)

self.save()
self.save(exp_root=exp_root)
self._run(n_jobs, parallel_backend, strict_reproducibility, n_relaunch)
_, summary_df, _ = self.get_results()
logger.info("\n" + str(summary_df))
Expand Down

0 comments on commit e6c19be

Please sign in to comment.