diff options
| author | J08nY | 2025-11-02 19:26:21 +0100 |
|---|---|---|
| committer | J08nY | 2025-11-02 19:26:21 +0100 |
| commit | e38c64e29285fd08c52c5d40bdac92cc05503f71 (patch) | |
| tree | 75698bb81bac8f64647e71192137cfb7dd44f864 | |
| parent | 1895bd897eb893ec628e7e84a74b94f6c25d6f4e (diff) | |
| download | ECTester-e38c64e29285fd08c52c5d40bdac92cc05503f71.tar.gz ECTester-e38c64e29285fd08c52c5d40bdac92cc05503f71.tar.zst ECTester-e38c64e29285fd08c52c5d40bdac92cc05503f71.zip | |
Handle incomplete zstd entry due to shortened run in make_probs.
| -rw-r--r-- | analysis/scalarmults/epare/standalone/make_probs.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/analysis/scalarmults/epare/standalone/make_probs.py b/analysis/scalarmults/epare/standalone/make_probs.py index 94e36e6..214e9f7 100644 --- a/analysis/scalarmults/epare/standalone/make_probs.py +++ b/analysis/scalarmults/epare/standalone/make_probs.py @@ -22,8 +22,10 @@ from ..prob_map import ProbMap if sys.version_info >= (3, 14): from compression import zstd + from compression.zstd import ZstdError else: from backports import zstd + from backports.zstd import ZstdError @click.command() @@ -53,10 +55,14 @@ def main(temp, workers, seed): mode = "ab" with zstd.open(out_path, "rb") as h: # Skip already done. + last = 0 try: while True: + last = h.tell() full, probs = pickle.load(h) done.add(full.with_error_model(None)) + except ZstdError: + h.truncate(last) except EOFError: pass else: |
