Skip to content

Commit c6721c7

Browse files
committed
fix(database): preserve empty checkpoint layout
Keep the programs directory absent when saving an empty database, matching the pre-optimization checkpoint structure.
1 parent 13f5ae8 commit c6721c7

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

openevolve/database.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,8 @@ def save(self, path: Optional[str] = None, iteration: int = 0) -> None:
620620

621621
# Create the programs directory once rather than once per program
622622
programs_dir = os.path.join(save_path, "programs")
623-
os.makedirs(programs_dir, exist_ok=True)
623+
if self.programs:
624+
os.makedirs(programs_dir, exist_ok=True)
624625

625626
# Neither of these can change while the loop runs
626627
prompts_by_program = self.prompts_by_program

0 commit comments

Comments
 (0)