Skip to content

Commit f35dea0

Browse files
authored
slugify study_name (#114)
1 parent 1ebb896 commit f35dea0

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ gitpython # for the reproducibility script
2121
requests
2222
matplotlib
2323
ray[default]
24+
python-slugify

src/agentlab/experiments/study.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
11
import gzip
22
import logging
33
import pickle
4+
import re
5+
import uuid
46
from dataclasses import dataclass
57
from datetime import datetime
68
from pathlib import Path
7-
import uuid
89

910
import bgym
1011
from bgym import Benchmark, EnvArgs, ExpArgs
12+
from slugify import slugify
1113

1214
from agentlab.agents.agent_args import AgentArgs
1315
from agentlab.analyze import inspect_results
1416
from agentlab.experiments import args
1517
from agentlab.experiments import reproducibility_util as repro
1618
from agentlab.experiments.exp_utils import RESULTS_DIR, add_dependencies
17-
from agentlab.experiments.launch_exp import find_incomplete, run_experiments, non_dummy_count
19+
from agentlab.experiments.launch_exp import (
20+
find_incomplete,
21+
non_dummy_count,
22+
run_experiments,
23+
)
1824

1925
logger = logging.getLogger(__name__)
2026

@@ -220,6 +226,9 @@ def name(self):
220226
study_name = f"{agent_names[0]}_on_{self.benchmark.name}"
221227
else:
222228
study_name = f"{len(agent_names)}_agents_on_{self.benchmark.name}"
229+
230+
study_name = slugify(study_name, max_length=100, allow_unicode=True)
231+
223232
if self.suffix:
224233
study_name += f"_{self.suffix}"
225234
return study_name

0 commit comments

Comments
 (0)