From b56a769d66bf243a8f00d41aa29d6e524aaad8ba Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Fri, 12 Jul 2024 20:00:35 +0100 Subject: [PATCH] SaveIters: flush csv each row --- petric.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/petric.py b/petric.py index 4a675ed..81e5238 100755 --- a/petric.py +++ b/petric.py @@ -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", newline="", buffering=1)) self.csv.writerow(("iter", "objective")) def __call__(self, algo: Algorithm):