Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

small API change - passing exp_root to study.run() #200

Merged
merged 2 commits into from
Jan 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading