specsrbench.paths

Where the inputs and outputs live, and how they are found.

Three layers, in the order they are consulted:

  1. Environment variables. SPECSRBENCH_CACHE, SPECSRBENCH_SETS and SPECSRBENCH_FIGURES override everything. An installed wheel has no repo around it, so this is the only mechanism a pip install user has.

  2. A repo root walked up from the caller. A directory is the root if it holds cache_logR_tuned/. Note what is not in that test: anything to do with the manuscript. The figures used to require the paper source to sit beside the cache, which made every one of them unbuildable anywhere except inside one particular checkout.

  3. The current directory. So that specsrbench figures all in a fresh clone does the obvious thing.

Directories are not created on import. A module that only reads should fail with “no such directory” rather than silently make an empty one and then report a missing file inside it – the failure mode that sends people looking for a corrupted cache when the real problem is that they are in the wrong directory.

Functions

cache_dir()

The tuned cache every figure reads.

describe()

One line per resolved path, for printing at the top of a run.

figures_dir()

Where figure PDFs are written.

repo_root([start])

Directory holding cache_logR_tuned/, or the current directory.

sets_dir()

The paired evaluation/calibration/tuning sets the cache is built from.

specsrbench.paths.repo_root(start=None)[source]

Directory holding cache_logR_tuned/, or the current directory.

Parameters:

start (Path | str | None)

Return type:

Path

specsrbench.paths.cache_dir()[source]

The tuned cache every figure reads.

Return type:

Path

specsrbench.paths.sets_dir()[source]

The paired evaluation/calibration/tuning sets the cache is built from.

Separate from cache_dir() because the two have different lifetimes: the sets come out of specsr and the JADES tree and change only when the models or the split do, while the cache is rebuilt every time a classical parameter moves.

Return type:

Path

specsrbench.paths.figures_dir()[source]

Where figure PDFs are written.

paper/figures/ in the private repo, where the manuscript sits beside them and \includegraphics{figures/...} resolves relative to paper/paper.tex; plain figures/ everywhere else.

The condition is the presence of the manuscript directory, not its contents, and it is only about where output lands – nothing here reads the paper source. paper/ is one of the things make_public_release.sh refuses to ship, so an installed wheel and a clone of the public repo both take the second branch and write to figures/, which is what their README and docs describe. Getting this backwards would leave a pip install user with a directory named after a manuscript they do not have.

Return type:

Path

specsrbench.paths.describe()[source]

One line per resolved path, for printing at the top of a run.

Return type:

str