diff options
| author | J08nY | 2025-11-02 20:59:25 +0100 |
|---|---|---|
| committer | J08nY | 2025-11-02 20:59:25 +0100 |
| commit | 942c1105de4b3fd3e8abc35a31b4c3f33f6ad405 (patch) | |
| tree | 5450bc9db5dc61bed6e66e63324df3f901d3beca | |
| parent | e38c64e29285fd08c52c5d40bdac92cc05503f71 (diff) | |
| download | ECTester-942c1105de4b3fd3e8abc35a31b4c3f33f6ad405.tar.gz ECTester-942c1105de4b3fd3e8abc35a31b4c3f33f6ad405.tar.zst ECTester-942c1105de4b3fd3e8abc35a31b4c3f33f6ad405.zip | |
| -rw-r--r-- | analysis/scalarmults/epare/standalone/make_probs.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/analysis/scalarmults/epare/standalone/make_probs.py b/analysis/scalarmults/epare/standalone/make_probs.py index 214e9f7..a46b66d 100644 --- a/analysis/scalarmults/epare/standalone/make_probs.py +++ b/analysis/scalarmults/epare/standalone/make_probs.py @@ -53,18 +53,18 @@ def main(temp, workers, seed): done = set() if out_path.exists(): mode = "ab" - with zstd.open(out_path, "rb") as h: + out_path_tmp = out_path.replace(out_path.with_suffix(".prev")) + with zstd.open(out_path_tmp, "rb") as h, zstd.open(out_path, "wb") as w: # Skip already done. - last = 0 try: while True: - last = h.tell() full, probs = pickle.load(h) + pickle.dump((full, probs), w) done.add(full.with_error_model(None)) - except ZstdError: - h.truncate(last) - except EOFError: + except: pass + out_path_tmp.unlink() + click.echo(f"Already done multiples: {len(done)}.") else: mode = "wb" |
