itasc.contact_analysis.config

The TOML run-config — Contact Analysis’s hand-authored knob file.

One small file, authored once and git-versioned (it carries code status, per the artifact-contract spec §1): it names the per-position catalog CSV, selects which quantities to compute, and supplies the shared build params. Everything in it is a run-level choice — the per-position table itself stays a CSV (tabular, many-row, with its own relative-path resolution); this file is the “author once, then run” surface a single run(config) entry point consumes.

The run produces label-agnostic tidy tables only; no classification step and no plot/figure export live here (a subpopulation classification and any plots are a downstream, dataset-specific concern).

Paths resolve relative to the config file’s own directory, so a project folder is relocatable: keep config.toml next to catalog.csv and the whole thing moves together.

Functions

load_config(config_path)

Parse the TOML run-config at config_path into a RunConfig.

write_config(path, *[, catalog, out_dir, ...])

Author a TOML run-config at path — the inverse of load_config().

Classes

RunConfig(catalog[, out_dir, quantities, params])

A parsed run-config.

class itasc.contact_analysis.config.RunConfig(catalog, out_dir=None, quantities=(), params=<factory>)[source]

Bases: object

A parsed run-config. Paths are absolute (resolved against the config dir).

quantities empty means “every available quantifier”; a non-empty tuple selects a subset by quantity_id (dependency producers are pulled in at run time even when omitted). params is the shared build-knob mapping threaded to quantifiers that opt in. out_dir is where the pooled tidy tables land (flat); None defaults to the catalogue root (the positions’ common ancestor).

Parameters:
catalog: Path
out_dir: Path | None = None
quantities: tuple[str, ...] = ()
params: dict
itasc.contact_analysis.config.load_config(config_path)[source]

Parse the TOML run-config at config_path into a RunConfig.

catalog is required. Relative paths resolve against the config file’s directory. Selected quantities are validated against the registered quantifiers so a typo fails loudly rather than silently computing nothing.

Return type:

RunConfig

Parameters:

config_path (Path | str)

itasc.contact_analysis.config.write_config(path, *, catalog='catalog.csv', out_dir=None, quantities=(), params=None)[source]

Author a TOML run-config at path — the inverse of load_config().

Paths are written relative (verbatim), so the project folder stays relocatable. out_dir (where the flat tables land) is emitted only when given. quantities is emitted only when non-empty (empty round-trips to () = “all”). params keys that are None are dropped (an unset pixel size etc.). load_config(write_config(path, ...)) reproduces the inputs (paths resolved against path.parent). Returns path.

Return type:

Path

Parameters: