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

added study.shuffle_exps() feature #202

Merged
merged 3 commits into from
Jan 14, 2025
Merged
Changes from 1 commit
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
6 changes: 6 additions & 0 deletions src/agentlab/experiments/study.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ def get_results(self, suffix="", also_save=True):

return result_df, summary_df, error_report

def shuffle_exps(self):
"""Shuffle the experiments in the study."""
import random

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for pickyness.
can you put random as general import
also, instead of in-place, could we put a copy. it would be safer in case a user is having a copy of that ref somewhere it would be unexpectedly shuffled.

random.shuffle(self.exp_args_list)


@dataclass
class Study(AbstractStudy):
Expand Down
Loading