Skip to content

Commit

Permalink
SaveIters: flush csv each row
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed Jul 12, 2024
1 parent 11112d2 commit 2ace675
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion petric.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(self, verbose=1, outdir=OUTDIR, csv_file='objectives.csv'):
super().__init__(verbose)
self.outdir = Path(outdir)
self.outdir.mkdir(parents=True, exist_ok=True)
self.csv = csv.writer((self.outdir / csv_file).open("w", newline=""))
self.csv = csv.writer((self.outdir / csv_file).open("w", buffering=1))
self.csv.writerow(("iter", "objective"))

def __call__(self, algo: Algorithm):
Expand Down

0 comments on commit 2ace675

Please sign in to comment.