jaxrens.unvalidated¶
Mark code paths that have never been exercised in a production simulation.
This is about validation, not test coverage. A function marked here may be
fully unit-tested and still carry the marker: what is missing is a real nested
sampling run whose output someone looked at and believed. The two axes are
orthogonal — use # pragma: no cover for the coverage gap, and this module
for “I am not yet confident this does what I intended”.
Usage:
from jaxrens.unvalidated import unvalidated
@unvalidated(
concern="the accept criterion is a hard delta_H < 1.0 cut, not a "
"Metropolis test",
since="0.2.2",
clears_when="an NS run whose HMC accept rate tracks the random-walk move",
)
def build_kernel(...):
...
The decorator registers at import (so the unvalidated surface is enumerable
without calling anything, see REGISTRY) and warns on the first call
(so a user only hears about the paths they actually touch). Every marker that
fires is recorded in triggered(), which is what the HDF5 trajectory
writer stamps into the output file — a transient stderr warning is invisible in
a batch job, but a caveat attached to the data survives.
Policy is set by the JAXRENS_UNVALIDATED env var:
warn(default)Emit an
UnvalidatedFeatureWarningonce per feature, and log it to thejaxrenslogger (so it lands in the run’s log file).ignoreStay silent, but still record the marker in
triggered()so the output file is stamped regardless.errorRaise. Useful for a production campaign where you want a hard guarantee that nothing unvalidated was touched.
Deliberately stdlib-only: this module is imported from JAX-free paths (notably
jaxrens.io.trajectory) and must not pull JAX in.
Module Attributes
Every marker declared at import time, keyed by feature name. |
Functions
Render records (default: |
|
Forget which markers have fired, so they warn again. |
|
Markers that have actually fired in this process, in trigger order. |
|
Decorator marking a function as never run in a production simulation. |
|
Flag feature as unvalidated, once per process. |
Classes
Type variable. |
|
Provenance record for one unvalidated code path. |
Exceptions
|
A code path that has never been exercised in a production simulation. |