Step 0 — settings¶
The first notebook. nb2slurm parameterises only this one: it injects the
varying values (n_samples, seed) plus outdir, and the notebook writes a
settings.json that every later notebook reads.
NOTE that the cell below has a tag: parameters.
# papermill replaces these defaults per job; they make the notebook
# runnable locally on its own too.
n_samples = "1000"
seed = "1"
outdir = "."
import nb2slurm
# the varying values arrive as strings (from the command line on SLURM) -> int
nb2slurm.Settings.write(
outdir,
{
"n_samples": int(n_samples),
"seed": int(seed),
"outdir": outdir,
},
)
print(f"settings written for n_samples={n_samples}, seed={seed}")