Skip to content

Commit 987251f

Browse files
committed
Enhance comments in _TraceRun class for clarity on event handling and cleanup process. Added note regarding flushing behavior for dualbound_improved events.
1 parent 7fd53cf commit 987251f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/pyscipopt/recipes/realtime_trace_jsonl.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def eventexec(hdlr, event):
6060
elif et == SCIP_EVENTTYPE.DUALBOUNDIMPROVED:
6161
snapshot = self._snapshot_now()
6262
self._last_snapshot = snapshot
63+
# Flush disabled: frequent event; OS buffering suffices
6364
self._write_event(
6465
"dualbound_improved", fields=snapshot, flush=False
6566
)
@@ -99,7 +100,8 @@ def __exit__(self, exc_type, exc, tb):
99100
try:
100101
self.model.dropEvent(et, self._handler)
101102
except Exception:
102-
pass # Best-effort cleanup; continue dropping remaining events
103+
# Best-effort cleanup; continue dropping remaining events
104+
pass
103105
self._caught_events.clear()
104106
self._handler = None
105107

0 commit comments

Comments
 (0)