pbn 2026.11.22
-
save_results(..., d)saves each named argument as one result under its name. A call with the namesexclusions,estimates,tablesandextraworks as before. -
save_results()stops on a result namedmanifest, an unnamed result, a repeated or non-syntactic name, and a call with no result. -
dis required, so a call ofsave_results()withoutdstops. Passd = d, ord = NULLwhen the run has no single data table. Before,dwasNULLby default. -
exclusionsis optional. When it is there, the ruleexclusions_tablechecks it as before.estimatesno longer has to be a data.frame, andtablesno longer has to be a list of data.frames. - A result MAY be a data.frame, an atomic vector,
NULL, or a list of these to any depth. The new ruleallowed_objectsreplacesno_fitted_models. It also fails a function, an environment, an S4 or R6 object, a formula and a list with a class outside a fixed set. The detail names the path and the class. - The new rule
element_namesreplacestop_level_names. The rulesexclusions_table,no_row_per_person,manifest_scenario,manifest_dataandmanifest_sourcekeep their names. -
run_scenarios()stacks every element of the results. Before, it droppedextra. A data.frame gets a first columnsim, and a list is stacked element by element. Each other value becomes a list with one entry for each simulation. - Stacking stops when two simulations differ in the structure at one path, and the error names the path and the two simulations.
-
no_row_per_personalso fails an atomic vector of lengthn_rows_dataand a matrix or an array with a dimensionn_rows_data, for examplefitted(fit). It does not look inmanifest, and it checks nothing whenn_rows_datais 0 or 1. Before, a 1-row table failed when the data had 1 row. -
allowed_objectsandno_row_per_personalso walk the attributes of each object, so thetermsattribute of a model frame fails. They skip the attributes that R and data.table set, for examplenamesand.internal.selfref. - The detail of
allowed_objectsgives a fix for a model, a formula, anhtest, aPOSIXlt, apackage_versionand ansfgeometry. - Stacking stops on a nested list that is unnamed or partly named, and on
NULLin the place of a value. It also stops on a data.frame column of another class, a factor column with other levels, and a data.frame with a columnsim. - A results file that pbn 2026.11.21 wrote passes the new rules, unless it holds an object that
allowed_objectsorno_row_per_personfails.
pbn 2026.11.21
-
run_scenarios()writes the stdout and the stderr of each run torun.login the results folder of the simulation. For a failed run, it prints the whole log, and the error names the run and the log. Before, the output was in the error message, and R cuts an error message at 1000 bytes by default. - New argument
workersofrun_scenarios(): the number of simulations that run at the same time, each in a new R session. After a failed run, no new run starts, the started runs end, and the error names each failed run. - New argument
resumeofrun_scenarios(). WithTRUE, it keeps each simulation with aresults.qs2from a completed run of the same run script and functions folder, and runs the others. The defaultFALSEruns every simulation. - After a run that succeeds,
run_scenarios()writesrun.okwith the md5 ofresults.qs2. A run that quits with status 0 but writes no validresults.qs2for its scenario and simulation now fails. Before, a scenario with 1 simulation and noexpect_function could pass with an invalid file. -
run.logandrun.okare run artefacts: list both in the.gitignoreof a project.check_project()does not read them. - The manifest gains
source_md5, the md5 of the run script and of each file of the functions folder, for every scenario. Newcheck_results()rulemanifest_source. - A
results.qs2that pbn 2026.11.20 or older wrote has nosource_md5. It failsmanifest_sourceand thecheck_project()ruleresults_contract: run the scenarios again to write it. - Each column of
CFG$scenariosother thanscenarioandsimsis a setting of the scenario.initialize_project()returns the settings of the run assettings, and the manifest stores them. A list column or anNAis an error. Before, pbn dropped these columns without a message. -
run_scenarios()deletes thecheck.csvof each chosen scenario and each stackedresults.qs2before the first run, and theresults.qs2of each simulation that it runs. - pbn no longer imports
plnr.run_scenarios()starts and watches its R sessions withcallr.
pbn 2026.11.20
- New article
vignette("pbn"), Get started. It builds a small fake project file by file and runs it. The README links to it and no longer holds the walk-through.
pbn 2026.11.19
- For a fake scenario, the manifest has
fake_md5, the md5 of the code offake_<scenario>(), in the place ofdata_md5. A writer such ashaven::write_sav()stamps the time into a file, sodata_md5changed on every run. This changes the format ofresults.qs2. The newcheck_results()rulemanifest_datafails the results file of a fake scenario that an older pbn wrote: run the scenarios again to write it. The rule also fails adata_md5orfake_md5that is not in the form of an md5. -
run_scenarios()keeps the class of each stacked table, so a data.table in simulation 1 gives a stacked data.table. Before, every stacked table was a data.frame. - New
check_project()ruleuse_scenario_lines. AvNN_run.RMUST have exactly one top-level comment# pbn::use_scenario("<name>", sim = 1)abovepbn::initialize_project()for each scenario ofCFG$scenarios. A comment for another scenario fails too. To read them,check_project()sourcesvNN_functions/in a new R session, so it runs project code.
pbn 2026.11.18
- Removed the
scenarioargument ofinitialize_project(). A call that still passes it stops with R’s unused-argument error. The command linescenario=<name> sim=<k>gives the scenario, or else the newuse_scenario(), or else"real". - New
use_scenario(scenario, sim = 1)chooses the scenario for the rest of the R session when a person steps through a run script by hand. It stops in a non-interactive R session. - In an interactive R session,
initialize_project()prints one line with the scenario and the simulation, and(fake)for a fake scenario. A call that stops leaves no run forsave_results()orend_if_fake_scenario(). - New
end_if_fake_scenario()ends a run script aftersave_results()for a fake scenario, so the output part runs for the real data only. It quits with status 0 underRscript, andrun_scenarios()counts that as a success. - New
check_project()ruleno_active_use_scenario. It fails an active call or the referencepbn::use_scenario, also in a function body or anif.run_script_initialisesnames each argument thatinitialize_project()does not have. -
unknown_pathknowsrun_scenarios.R. It no longer knowsvNN_output.R: the output part goes invNN_run.R, afterend_if_fake_scenario().
pbn 2026.11.17
- Scenarios:
CFG$scenariosnames the real data and the fake scenarios, with the number of simulations of each. The same run script runs on each. -
initialize_project()takesscenario, and readsscenario=<name>andsim=<k>from the command line. It sets the seed to the simulation before org sources the functions and again before it callsfake_<scenario>(dir)for fake data. - Results go to
vNN_results/<scenario>/results.qs2, or tovNN_results/<scenario>/sim_NNNN/results.qs2for a scenario with more than 1 simulation. pbn needsorg2026.11.16 for this. - New
run_scenarios()runs every simulation of every scenario in a new R session with aplnrplan, stacks the simulations, and checks them withexpect_<scenario>(). -
run_scenarios()needsexpect_<scenario>()for every fake scenario, and stops before any run when one is missing. Anexpect_function that errors or returns no assertions counts as a failed assertion. -
run_scenarios()deletes the results of a simulation before it runs it, and stops when the run writes noresults.qs2. An older file is never stacked or checked. -
read_results()takesscenario(default"real") andsim. - The manifest gains
scenario,simandsims. Newcheck_results()rulemanifest_scenario. - New
check_project()rulesscenario_checksandmanuscript_reads_real.results_contractfails aresults.qs2directly invNN_results/.unknown_pathknowsvNN_output.R. - Removed:
run_version(), the command-line argumentdata_raw=<path>, the foldervNN_results/scenario/<name>/,manifest$data_raw_source, the stops of adata_raw=run, andvNN_check_scenarios.Rfrom the known names ofunknown_path.
The entries below describe the first push of this version.
- First trial version: the house layout,
check_project(), the results contract,table1(), andrun_version(). - A run with
data_raw=<path>writes its results to<version>_results/scenario/<basename of the normalised path>/, so it never overwrites the realresults.qs2. -
initialize_project()resolves..,~and a trailing slash indata_raw=<path>first. Before,data_raw=..wrote over the realresults.qs2. - A scenario run stops when its data folder is the default data folder, or is or holds the real results folder.
- A scenario run stops when its scenario folder holds the results of another data folder with the same basename.
-
manifest$data_md5lists the files in the data folder atinitialize_project(), so a file that the run writes later is not an input. -
manifest$packagesalways namesqs2, andmanifest$run_dateis the date only, so an unchanged run on the same day writes the same bytes. -
table1()stops on a level ofbynamed"All". A level with no non-missing value is left out of the test. With fewer than two groups left,pandtestareNA. - In a git repository,
check_project()reads only the files that git does not ignore. It never reads.DS_Store,.Rhistory,.RData,~$*or.Rproj.user/. -
check_project()checks theresults.qs2of every scenario folder, andunknown_pathknowsvNN_check_functions.R,vNN_check_scenarios.R, top-level dotfiles and*.Rproj.
