vibeqc.perf_log

vibeqc.perf_log(path=None)[source]

Activate a fresh PerfTracker for the duration of the block; write the formatted report to path on exit.

Resolution order for path:

  1. Explicit argument when not None.

  2. $VIBEQC_PERFLOG env var.

  3. No file written (the tracker still accumulates and the user can read it from the yielded value).

Nesting two perf_log() blocks is allowed but discouraged — the inner block’s tracker is independent and only inner-block work routes there. Most callers want a single top-level block.

Example:

import vibeqc as vq
with vq.perf_log("h2o.perf") as tracker:
    vq.run_rhf(mol, basis, opts)
# h2o.perf now exists; tracker.phases is also accessible
# post-block for programmatic inspection.
Parameters:

path (str | PathLike | None)

Return type:

Iterator[PerfTracker]