pyfracval.event_log#
Structured, append-only event log for aggregate generation.
Existing telemetry answers “did this run succeed”. A paper needs
something else: where generation fails, why, and how badly -
pooled over thousands of runs and sliceable by the physics
(Df, kf, sigma_p,geo, N). Free-text log lines cannot be
aggregated, and the in-memory diagnostics dict run_simulation
accepts is per-call and never persisted.
This module writes one JSONL file carrying three record kinds, each stamped with the same run context so they can be sliced or joined together:
mergeOne CCA merge attempt: which round, which cluster pair, the contact distance attempted, how much of the search was consumed, the outcome, and - when a census ran - how many particles ended up overlapping and by how much.
pca_failureA PCA subcluster that could not be built: at which particle index, with how many candidate partners available, after how many search/swap attempts. Without this, “where does it fail” cannot distinguish a PCA failure from a CCA one with any detail, even though both occur.
runOne completed or abandoned aggregate: outcome, failure stage and reason, attempts consumed, wall time, and the final geometry’s measured quality.
Enable with OrchestratorAlgorithmConfig.event_log_path. Nothing is
written and no file is opened when it is unset.
Concurrency: records are written as single write() calls of one line
each in append mode, which is atomic enough on POSIX for several Dask
workers to share one path. Every record carries run_id and pid so
interleaved lines can always be separated again.
Module Contents#
- class pyfracval.event_log.MergeEvent[source]#
One CCA merge attempt between two clusters.
- round_index[source]#
Which CCA round (1-based). Round 1 merges the initial PCA subclusters - the round essentially every hard-regime failure occurs in (docs/source/pairing_frustration.md).
- Type:
- cluster_idx1, cluster_idx2
Indices of the two clusters within the round’s pool.
- Type:
- n1, n2
Particle counts of the two clusters.
- Type:
- outcome[source]#
One of
stuck,stuck_relaxed_tol,failed_no_candidates,failed_overlap,rescued_soft_relaxation,rescued_drop,failed_gamma_not_real,skipped_bv_filter.- Type:
- min_overlap[source]#
Best (smallest) max-overlap reached, normalized by
r_i + r_jso it is directly comparable totol_ov.- Type:
- n_offending_particles[source]#
Distinct particles involved in a residual overlap at give-up.
- Type:
int | None
- max_overlap_of_rsum[source]#
Worst residual overlap at give-up, normalized by
r_i + r_jand therefore comparable totol_ov.- Type:
float | None
- max_overlap_of_rmin[source]#
The same overlap normalized by
min(r_i, r_j). Recorded separately because the two denominators differ by a large factor for wide size distributions and must never be conflated.- Type:
float | None
- class pyfracval.event_log.PcaFailureEvent[source]#
A PCA subcluster that could not be completed.
PCA failure is a distinct mechanism from CCA sticking failure: it happens while growing a single subcluster particle by particle, and the usual cause is that no already-placed particle sits at a workable distance for the next monomer’s Gamma. Recording it separately is what lets a failure taxonomy attribute blame correctly instead of lumping everything under “the run failed”.