mathxlab.exp.run_logging¶
Utilities for run log file discovery.
Stability
Status: Experimental.
This project treats the documented names as the public surface, but details may still evolve.
If you need strict API guarantees, add __all__ = [...] to each module and version releases accordingly.
Design notes¶
Keep experiment scripts small: delegate I/O, seeding, and logging here.
Aim for reproducible outputs (fixed seeds, stable file names).
Examples¶
Infer the run log file path¶
from pathlib import Path
from mathxlab.exp.run_logging import infer_run_log_file
print(infer_run_log_file(out_dir=Path("out/e001"), experiment_slug="e001"))
Public API¶
Name |
Kind |
Summary |
|---|---|---|
|
class |
Result of run log discovery. |
|
function |
Infer the run log file for an experiment. |
Reference¶
Classes¶
- class mathxlab.exp.run_logging.RunLogDiscovery(log_file, was_created)[source]¶
Bases:
objectResult of run log discovery.
- log_file¶
The discovered or newly created log file path.
- was_created¶
True if the deterministic log file did not exist and was created (or migrated) by discovery.
Examples
>>> from mathxlab.exp.run_logging import RunLogDiscovery >>> RunLogDiscovery
Functions¶
- mathxlab.exp.run_logging.infer_run_log_file(*, out_dir, experiment_slug)[source]¶
Infer the run log file for an experiment.
- Parameters:
out_dir – Output directory for the experiment (e.g.
out/e094).experiment_slug – Experiment slug used by the Makefile (e.g.
"e094").
- Returns:
A
RunLogDiscoverywith the deterministic log file path.
Examples
>>> from pathlib import Path >>> from mathxlab.exp.run_logging import infer_run_log_file >>> info = infer_run_log_file(out_dir=Path("out/e001"), experiment_slug="e001")