summaryrefslogtreecommitdiff
path: root/protocol
diff options
context:
space:
mode:
Diffstat (limited to 'protocol')
-rw-r--r--protocol/examples/temporal_diagnostic_evolution.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/protocol/examples/temporal_diagnostic_evolution.py b/protocol/examples/temporal_diagnostic_evolution.py
index e349cec..6a2c042 100644
--- a/protocol/examples/temporal_diagnostic_evolution.py
+++ b/protocol/examples/temporal_diagnostic_evolution.py
@@ -55,9 +55,16 @@ def first_fire_epoch(log, predicate):
def main():
+ import argparse
+ p = argparse.ArgumentParser()
+ p.add_argument("--seed", type=int, default=42)
+ args = p.parse_args()
snapshot_path = os.path.join(
- REPO_ROOT, "results/snapshot_evolution_v2/snapshot_evolution_s42.json"
+ REPO_ROOT, f"results/snapshot_evolution_v2/snapshot_evolution_s{args.seed}.json"
)
+ if not os.path.exists(snapshot_path):
+ print(f"snapshot not found: {snapshot_path}")
+ return
with open(snapshot_path) as f:
d = json.load(f)
bp_log = d["bp_log"]
@@ -157,7 +164,7 @@ def main():
"h_norm_explosion_ratio": THRESHOLDS.h_norm_explosion_ratio,
},
}
- out_path = os.path.join(REPO_ROOT, "results/protocol_audit/temporal_evolution_s42.json")
+ out_path = os.path.join(REPO_ROOT, f"results/protocol_audit/temporal_evolution_s{args.seed}.json")
with open(out_path, "w") as f:
json.dump(out, f, indent=2)
print(f"\nSaved {out_path}")