vibespin.scripts package

Subpackages

Submodules

scripts.generate_all module

Regenerate every cached dataset the notebooks read.

Each notebook loads a NPZ file if it finds one and otherwise recomputes a reduced version of the same physics inline, so a fresh checkout renders but does so at fallback quality. This script produces the full set in one command, in dependency-free order, reporting what it ran and how long each step took.

Two profiles are available. The default runs every script at its own production defaults, which is the data the published figures are built from and takes roughly an hour on four cores. --quick runs the same scripts with sharply reduced lattices, temperature grids, and step counts; it is a smoke test of the pipeline in a couple of minutes and its output is not suitable for physics.

scripts.generate_all.DATA_PRODUCTS: tuple[DataProduct, ...] = (('ising/temperature_sweep', 'scripts.ising.temperature_sweep', 'ising/temperature_sweep_data.npz', ('--size', '16', '--t-points', '6', '--n-seeds', '1', '--meas-steps', '400', '--eq-max-steps', '2000')), ('ising/measure_z', 'scripts.ising.measure_z', 'ising/dynamic_exponent_z.npz', ('--sizes', '8', '12', '--n-seeds', '1', '--meas-steps-metro', '400', '--meas-steps-wolff', '200', '--eq-max-steps', '2000')), ('ising/wolff_efficiency', 'scripts.ising.wolff_efficiency', 'ising/wolff_efficiency.npz', ('--size', '16', '--t-points', '5', '--n-seeds', '1', '--meas-steps', '400', '--eq-max-steps', '2000')), ('ising/correlation_comparison', 'scripts.ising.correlation_comparison', 'ising/correlation_comparison.npz', ('--size', '24', '--steps', '400', '--eq-max', '2000')), ('ising/correlation_divergence', 'scripts.ising.correlation_divergence', 'ising/correlation_divergence.npz', ('--size', '24', '--steps', '400', '--eq-steps', '200')), ('ising/ordering_kinetics', 'scripts.ising.ordering_kinetics', 'ising/ordering_kinetics.npz', ('--size', '32', '--max-steps', '200', '--samples', '12', '--n-seeds', '1')), ('ising/coarsening_analysis', 'scripts.ising.coarsening_analysis', 'ising/coarsening_analysis.npz', ('--size', '32', '--quench-steps', '200', '--quench-seeds', '1', '--bridge-steps', '200', '--bridge-seeds', '1', '--ens-steps', '200', '--ens-seeds', '2', '--xi-eq-max', '2000', '--xi-eq-steps', '200')), ('xy/temperature_sweep', 'scripts.xy.temperature_sweep', 'xy/temperature_sweep_data.npz', ('--size', '16', '--t-points', '6', '--n-seeds', '1', '--meas-steps', '400', '--eq-max-steps', '2000')), ('xy/bkt_transition', 'scripts.xy.bkt_transition', 'xy/bkt_transition.npz', ('--size', '16', '--t-points', '5', '--meas-steps', '400', '--eq-max-steps', '2000')), ('xy/helicity_modulus', 'scripts.xy.helicity_modulus', 'xy/helicity_modulus.npz', ('--size', '16', '--t-points', '5', '--meas-steps', '400', '--eq-max-steps', '2000')), ('xy/wolff_efficiency', 'scripts.xy.wolff_efficiency', 'xy/wolff_efficiency.npz', ('--size', '16', '--t-points', '5', '--n-seeds', '1', '--meas-steps', '400', '--eq-max-steps', '2000')), ('xy/correlation_comparison', 'scripts.xy.correlation_comparison', 'xy/correlation_comparison.npz', ('--size', '24', '--steps', '400', '--eq-max', '2000')), ('xy/ordering_kinetics', 'scripts.xy.ordering_kinetics', 'xy/ordering_kinetics.npz', ('--size', '32', '--max-steps', '200', '--samples', '12', '--n-seeds', '1')), ('clock/temperature_sweep', 'scripts.clock.temperature_sweep', 'clock/temperature_sweep_data.npz', ('--size', '16', '--t-points', '6', '--n-seeds', '1', '--meas-steps', '400', '--eq-max-steps', '2000')), ('clock/wolff_efficiency', 'scripts.clock.wolff_efficiency', 'clock/wolff_efficiency.npz', ('--size', '16', '--t-points', '5', '--n-seeds', '1', '--meas-steps', '400', '--eq-max-steps', '2000')), ('clock/correlation_comparison', 'scripts.clock.correlation_comparison', 'clock/correlation_comparison.npz', ('--size', '24', '--steps', '400', '--eq-max', '2000')), ('clock/ordering_kinetics', 'scripts.clock.ordering_kinetics', 'clock/ordering_kinetics.npz', ('--size', '32', '--max-steps', '200', '--samples', '12', '--n-seeds', '1')), ('benchmarks/throughput', 'scripts.benchmarks.throughput', 'benchmarks/scaling_benchmark.npz', ('--sizes', '16', '24', '--sweeps', '20')))

Every dataset a notebook loads, in the order the pipeline table of SCRIPTS.md lists them. Scripts that only draw a figure are not included because no notebook depends on their output.

class scripts.generate_all.DataProduct(key: str, module: str, output: str, quick_args: tuple[str, ...])[source]

Bases: NamedTuple

One script invocation and the file it is expected to produce.

Parameters:
  • key (str) – Selector of the form model/script, matched by --only and --skip and printed by --list.

  • module (str) – Importable module path run with python -m.

  • output (str) – Path of the NPZ file relative to the output root, used by --skip-existing and by the completion report.

  • quick_args (tuple[str, ...]) – Arguments that replace the production defaults under --quick.

key: str

Alias for field number 0

module: str

Alias for field number 1

output: str

Alias for field number 2

quick_args: tuple[str, ...]

Alias for field number 3

scripts.generate_all.main() → None[source]

Regenerate the cached notebook datasets and report the outcome.

Raises:

SystemExit – With a non-zero status if any script failed, so that the command can be used as a build step.

scripts.generate_all.run_product(*, product: DataProduct, output_root: str, quick: bool, dry_run: bool, logger: Logger) → tuple[bool, float][source]

Run one script and report whether it succeeded.

Parameters:
  • product (DataProduct) – Entry to run.

  • output_root (str) – Directory the per-model output directories live under.

  • quick (bool) – If True, pass the entry’s reduced arguments instead of relying on the script’s production defaults.

  • dry_run (bool) – If True, log the command and return without running it.

  • logger (logging.Logger) – Logger for progress output.

Returns:

Success flag and wall-clock seconds spent.

Return type:

tuple[bool, float]

scripts.generate_all.select_products(*, products: tuple[DataProduct, ...], only: list[str] | None, skip: list[str] | None) → list[DataProduct][source]

Filter the product table by substring match on the selector key.

Parameters:
  • products (tuple[DataProduct, ...]) – Full table to filter.

  • only (list[str] or None) – Keep a product if its key contains any of these substrings. None or an empty list keeps everything.

  • skip (list[str] or None) – Drop a product if its key contains any of these substrings, applied after only.

Returns:

Selected products in table order.

Return type:

list[DataProduct]

Raises:

ValueError – If a pattern in only or skip matches no key at all, which is almost always a typo rather than an intentionally empty selection.

Module contents