Stage 3 · Work with it
Single commands
Every command of DeltaRecon explained: what it does, an example to copy, its options, and the files it reads and writes.
Start a single command
The Quick start runs several of these commands for you. This page describes every command of the package on its own, in the order in which the package lists them. You start a single command in the package folder.
Windows
Open PowerShell in the package folder. Every command begins with the launcher .\deltarecon.cmd, followed by the name of the command. Paths are written with \.
Linux
Open a terminal in the package folder. Every command begins with the launcher ./deltarecon, followed by the name of the command.
The examples of this page are the commands that the guide README.txt in the package folder lists; the examples of compare and walk are the exceptions, the guide does not list them. They write to the folder runs in the package folder, and they build on each other in the order of this page: request writes what run reads, and so on. The folder runs is a free choice; the files of a run may lie in any folder.
No command overwrites an existing file. A command whose output exists already does not start. To repeat a calculation, give it an output that does not exist yet.
This page shows no output. Your own calculations on the reference model shows step by step what single commands print, and Understand the results explains how to read the tables of the demo.
Under the heading of each command stands its synopsis, as the help of the command prints it, for example ./deltarecon request --help. What stands between [ and ] may be left out. A word in capitals is a placeholder that you fill in; ... means that several may follow. Between { and } stand the choices, of which you pick one. The synopsis writes deltarecon for .\deltarecon.cmd or ./deltarecon. The words in small letters at the end are the paths that the command is given.
The exit status of a command
Every command ends with an exit status, a number that says how it ended. The command quickstart counts in its own way; its section says how.
-
Status 0: Done, and nothing to report
A run that succeeded, a replay that is reproduced, a comparison or a regression without a deviation, a request or a change manifest that was written, a walk that attributes every revision, a search whose two ends are reproduced.
-
Status 1: Something to look at, or a refusal
A run that failed, was rejected or ended with an error; a replay that is not reproduced; a comparison or a regression with a deviation; a change manifest that cannot be derived; a walk or a search that is refused or stops. The regression of the quick start ends with status 1 by design: it reports the deviation between the two revisions, and the next commands run all the same.
If something goes wrong in this section
request: say what is to be computed
Synopsis
deltarecon request --revision REVISION [--stage STAGE] --label LABEL
--run-id RUN_ID --output OUTPUT
[--subset MODEL_POINT_ID [MODEL_POINT_ID ...]]
[--enable CHANGE_ID [CHANGE_ID ...]]
[--manifest MANIFEST] [--engine MODULE:CLASS]
[--engine-path DIR] [--engine-option KEY=VALUE]
[--repositories DIR] request writes a run request: the file that says what is to be computed. It names the release completely, that is the code, the parameters and the input data, each by the full name of its revision, and the version of the core of the engine, which is not part of the history: for the reference model the libraries modelx, pandas and numpy, and Python itself. It also names the model points to run. request computes nothing; run does.
For the reference model a release is a revision of the history that the package holds in the folder delib-history. You name it by its full or abbreviated hash, by a branch, by a tag or by HEAD; a suffix such as HEAD~1 is not read. The request then holds the full hash.
The example writes the request for release N of the quick start.
Windows PowerShell
.\deltarecon.cmd request --revision fa368575a66d97c94e96dffc62b273ec95511b12 --label N --run-id run-n-full --output runs\n-full\request.json Linux
./deltarecon request --revision fa368575a66d97c94e96dffc62b273ec95511b12 --label N --run-id run-n-full --output runs/n-full/request.json The options of request:
- required
The release
--revisionThe release to compute, by a name that the engine reads. For the reference model see above.
- required
A label for the release
--labelA name of your choice for the release, for example
N. - required
A name for the run
--run-idNames the request. Two runs of one request carry the same name; the record of each run has an id of its own beside it.
- required
Where the request is written
--outputThe path of the request to write.
-
The stage
--stageThe stage of the request, one that the engine declares. You may leave it out when the engine declares one stage only.
-
Some model points only
--subsetThe ids of the model points to run, separated by spaces, for example
--subset RLV-000001 RLV-000002. Without it the run is full: every model point. -
Changes to enable
--enableThe ids of the changes of a change manifest that the run enables. Give it together with
--manifest. -
The change manifest of these changes
--manifestThe change manifest that holds the changes of
--enable. It lies in the folder of the request or below it. -
Shared options
--engine,--engine-path,--engine-option,--repositories. They are described under Options that several commands share.
The files of request:
Reads
-
The history of the model
delib-history/The folder of the package from which every command reads the releases of the reference model.
-
A change manifest
The file that
--manifestnames. Only with that option.
Writes
-
The request
request.jsonThe file that
--outputnames; in the examplerequest.jsonin the new foldern-full.
run: compute a request
Synopsis
deltarecon run [--workers N] [--engine MODULE:CLASS] [--engine-path DIR]
[--repositories DIR]
request run checks the request, restores the files of the named revision to a scratch folder, projects the selected model points and evaluates the five built-in checks of the model for each. It writes its files beside the request.
A run ends with one of four outcomes. succeeded: there are results. failed: a model point raised an error, a check is false, or a result is not a finite number; there are no results. error: the request was accepted, but the engine could not restore or read the state; there are no results. rejected: the request broke a rule, and nothing ran. The record is written for every outcome, except for a file that cannot be read as a run request.
Windows PowerShell
.\deltarecon.cmd run runs\n-full\request.json Linux
./deltarecon run runs/n-full/request.json The options of run:
-
Shared options
--workers,--engine,--engine-path,--repositories. They are described under Options that several commands share.
The files of run:
Reads
-
The request
request.jsonThe path that the command is given.
-
The history of the model
delib-history/The files of the revision that the request names.
Writes
-
The response
response.jsonHow the run ended: its outcome.
-
The results
results.csvThe export of the run, per model point. Only a run that succeeded has it.
-
The record
run-record.jsonWhat was computed with what. The commands that follow read this file.
If something goes wrong in this section
replay: repeat a recorded run
Synopsis
deltarecon replay [--tolerance FILE] [--workers N] [--engine MODULE:CLASS]
[--engine-path DIR] [--repositories DIR]
run_record replay checks a record, repeats its run in the new folder replay/ beside the record, and compares the recorded run with the repeated one. It prints whether the run is reproduced, how many values deviate, and the paths of its files.
The outcome is reproduced_exactly, reproduced_at_decimals or reproduced_within_tolerances, depending on what the tolerance profile holds, or not_reproduced. If the record or a file that it lists was altered after the run, the replay is rejected and writes nothing.
Windows PowerShell
.\deltarecon.cmd replay runs\n-full\run-record.json Linux
./deltarecon replay runs/n-full/run-record.json The options of replay:
-
Shared options
--tolerance,--workers,--engine,--engine-path,--repositories. They are described under Options that several commands share.
The files of replay:
Reads
-
The record
run-record.jsonThe path that the command is given, and with it the files of the run that the record lists.
-
The history of the model
delib-history/The files of the revision that the record names, for the repeated run.
-
A tolerance profile
The file that
--tolerancenames. Only with that option.
Writes
-
The repeated run
replay/The request, the response, the results and the record of the repeated run.
-
The comparison
replay-compare.request.jsonThe compare request that
replaywrites and runs itself, with its resultreplay-compare.result.json. -
The values that deviate
replay-compare.deviations.csvOne row per value that deviates. Written when the two runs are compared.
-
The record of the replay
replay-record.jsonLists the files of the replay.
compare: compare two runs
Synopsis
deltarecon compare request compare compares the two runs that a compare request names, value by value, under the tolerance profile of that request. When the two runs can be compared, it writes the values that deviate and a signature table, which has one row per quantity that deviates.
You will rarely start it yourself: replay, regression, walk and search write and run their compare requests themselves. The file replay-compare.request.json that replay writes is such a request; the example runs it once more. Build an adapter step by step shows how to write a compare request yourself.
Windows PowerShell
.\deltarecon.cmd compare runs\n-full\replay-compare.request.json Linux
./deltarecon compare runs/n-full/replay-compare.request.json compare takes no option, apart from the path of the compare request.
The files of compare:
Reads
-
The compare request
The path that the command is given, and with it the two runs that the request names.
Writes
-
The result
compare.result.jsonWritten beside the request. It lists the model points that deviate.
-
The values that deviate
compare.deviations.csvOne row per value above the tolerance. Written when the two runs are compared.
-
The signature table
signature-table.jsonPer quantity that deviates: in how many model points and values, in which periods, and the largest increase and decrease. Written when the two runs are compared.
-
The record of the comparison
compare.run-record.jsonWritten when the release of both runs can be read.
regression: check a recorded run against a newer revision
Synopsis
deltarecon regression --revision REVISION --output OUTPUT [--label LABEL]
[--tolerance FILE] [--workers N]
[--engine MODULE:CLASS] [--engine-path DIR]
[--engine-option KEY=VALUE] [--repositories DIR]
run_record regression starts from the record of a run that succeeded, a full run without enabled changes. It computes a newer revision that you name for the same model points as the recorded run, and compares the two runs. In the new run the code and the parameters are those of the newer revision, and the input data are those of the recorded run.
It reports that nothing deviates above the tolerance, or it prints every model point that deviates and the signature table. When the new run fails, ends with an error or is rejected, nothing is compared.
In the example the newer revision is the state N+1 of the quick start. The command ends with exit status 1 there, by design.
Windows PowerShell
.\deltarecon.cmd regression runs\n-full\run-record.json --revision 887b7181d22550eda2fb52fa1a6bd77376d4eb2e --output runs\regression-n Linux
./deltarecon regression runs/n-full/run-record.json --revision 887b7181d22550eda2fb52fa1a6bd77376d4eb2e --output runs/regression-n The options of regression:
- required
The newer release
--revisionThe release to compute and compare, named as for
request. - required
The folder to write
--outputA new folder; it must not exist.
-
A label for the newer release
--labelA name of your choice for the release that is computed. Without it the label is
regression. -
Shared options
--tolerance,--workers,--engine,--engine-path,--engine-option,--repositories. They are described under Options that several commands share.
The files of regression:
Reads
-
The record of the older run
run-record.jsonThe path that the command is given.
-
The history of the model
delib-history/The files of the newer revision.
-
A tolerance profile
The file that
--tolerancenames. Only with that option.
Writes
-
A copy of the recorded run
recorded/In the new folder that
--outputnames. -
The comparison
compare.request.jsonThe compare request that
regressionwrites and runs itself, with the files thatcomparewrites: among themcompare.result.jsonandsignature-table.json.
derive: list the changes between two recorded runs
Synopsis
deltarecon derive --output OUTPUT [--engine MODULE:CLASS]
[--engine-path DIR] [--repositories DIR]
older_record newer_record derive starts from the records of two runs that succeeded, both full runs without enabled changes, the older one first. It reads the history of the model between their two revisions and writes the change manifest: one change per revision on the main line of the history, after the older revision and up to the newer one, in the order of the history. A branch that was merged is one change, the merge.
Each change carries its class: data, parameter, code, several of them or none. What differs between the two records and belongs to no revision, another version of the core of the engine, is named as the remainder and belongs to no change. The command prints the changes and the remainder.
Two revisions that do not lie on one main line, also two records in the wrong order, are refused, and nothing is written. The same two records give the same file, byte for byte.
Windows PowerShell
.\deltarecon.cmd derive runs\n-full\run-record.json runs\regression-n\run\run-record.json --output runs\changes.json Linux
./deltarecon derive runs/n-full/run-record.json runs/regression-n/run/run-record.json --output runs/changes.json The options of derive:
- required
Where the change manifest is written
--outputThe path of the file to write. Its folder must exist.
-
Shared options
--engine,--engine-path,--repositories. They are described under Options that several commands share.
The files of derive:
Reads
-
The two records
run-record.jsonThe two paths that the command is given, the older record first. In the example the newer one is the record of the regression.
-
The history of the model
delib-history/The revisions between the two records.
Writes
-
The change manifest
changes.jsonThe file that
--outputnames.
walk: compute every state between two recorded runs
Synopsis
deltarecon walk --output OUTPUT [--tolerance FILE] [--workers N]
[--engine MODULE:CLASS] [--engine-path DIR]
[--repositories DIR]
older_record newer_record walk attributes the deviation between two recorded results to the revisions between them. It takes the same two records as derive, which must hold the same model points, derives the change manifest and computes every state: state 0 is the older revision, and one further state follows after each change. It checks state 0 against the older record and the last state against the newer one; each must reproduce its record, under the tolerance profile or, without one, exactly.
It then compares each state with the state before it. Its result says for each change and each quantity whether the change contributes, and gives the signed sum of the differences and the sum of their absolute values. Where the walk compares exactly, the signed sums of a quantity add up exactly to the deviation between the two records.
The input data move with the states when each record names its own revision as its input data. They stay at the older revision when both records name the same one, as the record of a regression does; that is the case in the example. A state that does not run is reported, and the next state that runs carries its change as well.
The walk is the reference result, and it computes the most: one state per change and one more, 33 in the example. How DeltaRecon works sets it beside the search.
Windows PowerShell
.\deltarecon.cmd walk runs\n-full\run-record.json runs\regression-n\run\run-record.json --tolerance profiles\tolerance-bruttobeitrag.json --output runs\walk Linux
./deltarecon walk runs/n-full/run-record.json runs/regression-n/run/run-record.json --tolerance profiles/tolerance-bruttobeitrag.json --output runs/walk The options of walk:
- required
The folder to write
--outputA new folder; it must not exist.
-
Shared options
--tolerance,--workers,--engine,--engine-path,--repositories. They are described under Options that several commands share.
The files of walk:
Reads
-
The two records
run-record.jsonThe two paths that the command is given, the older record first.
-
The history of the model
delib-history/The revisions between the two records, for every state.
-
A tolerance profile
The file that
--tolerancenames. Only with that option.
Writes
-
The result
walk.result.jsonIn the new folder that
--outputnames. The same two records give the same file, byte for byte. -
The record of the walk
walk.run-record.jsonWhat the walk was computed with.
-
Copies of the two recorded runs
older/The older run, and in
newer/the newer one. -
The states and their comparisons
state-00/One folder per state, the change manifest, and the comparison of every step that contributes.
search: find the changes that deviate, with fewer computations
Synopsis
deltarecon search --output OUTPUT [--quantity NAME] [--periods FIRST-LAST]
[--walk FOLDER] [--reuse-walk] [--target-only]
[--tolerance FILE] [--workers N] [--engine MODULE:CLASS]
[--engine-path DIR] [--repositories DIR]
older_record newer_record search takes the same two records as walk and makes the same checks before it computes. It needs no walk. It computes state 0 and the last state, checks them against the two records, and then halves the history: it judges an interval of the history by comparing the states at its two ends, does not divide an interval whose ends agree, and attributes a deviation to an interval that holds a single change. How DeltaRecon works explains the method and its limits.
You can narrow the search to a target with --quantity and --periods. Only the values of the target are then judged and summed. The example searches in the Bruttobeitrag in the periods 0 to 59, the first five projection years.
The result names the target, the intervals that were judged, the changes that contribute with their sums, and the findings, among them an interval that is “not resolved”. It also counts the states that the search computed, those that a walk would compute, and those it saved. The exit status is 0 when both ends ran and are reproduced.
Windows PowerShell
.\deltarecon.cmd search runs\n-full\run-record.json runs\regression-n\run\run-record.json --quantity Bruttobeitrag --periods 0-59 --tolerance profiles\tolerance-bruttobeitrag.json --target-only --output runs\search Linux
./deltarecon search runs/n-full/run-record.json runs/regression-n/run/run-record.json --quantity Bruttobeitrag --periods 0-59 --tolerance profiles/tolerance-bruttobeitrag.json --target-only --output runs/search The options of search:
- required
The folder to write
--outputA new folder; it must not exist.
-
A quantity of the target
--quantityThe name of a quantity. You may give the option several times. Without it the target holds every quantity.
-
The periods of the target
--periodsThe first and the last period, both included, as in
0-59. Periods are months counted from the valuation date, so period 0 is the first projection month of every model point. Without it the target holds every period. -
A walk to check against
--walkThe folder of a
walkof the same two records, under the same tolerance profile. The search copies it and names the contributions of the walk that it missed. -
States from that walk
--reuse-walkTakes every state that the search needs from the folder of the walk and does not compute it again. Needs
--walk. -
Inner states on the target alone
--target-onlyComputes every state between the two ends on the target alone, without the checks of the model; state 0 and the last state stay full runs. Needs a narrowed target:
--quantityfor a part of the quantities, or--periods. -
Shared options
--tolerance,--workers,--engine,--engine-path,--repositories. They are described under Options that several commands share.
The files of search:
Reads
-
The two records
run-record.jsonThe two paths that the command is given, the older record first.
-
The history of the model
delib-history/The revisions between the two records, for every state that the search computes.
-
A tolerance profile
The file that
--tolerancenames. Only with that option. -
The folder of a walk
The folder that
--walknames. Only with that option.
Writes
-
The result
search.result.jsonIn the new folder that
--outputnames. -
The record of the search
search.run-record.jsonWhat the search was computed with.
-
The change manifest
changes.jsonThe changes between the two records, as
derivewrites them. -
Copies of the two recorded runs
older/The older run, and in
newer/the newer one. -
The states and their comparisons
state-00/One folder per state that the search computed, and the comparison of every change that contributes.
-
The copy of the walk
walk/Only with
--walk.
quickstart: the guided demo
Synopsis
deltarecon quickstart [--no-pause] [--lang {de,en}] [--repositories DIR] quickstart is the command behind the guided demo of the Quick start. It runs request, run, regression, derive and search on the two revisions of the examples above, without replay, explains each of its four steps and waits for Enter before each. It always computes with the reference model. Its search compares under the tolerance profile tolerance-bruttobeitrag.json of the package; its regression compares exactly.
You start it through its starter, which changes to the package folder, hands its options on to quickstart and ends with its exit status:
Windows PowerShell
.\quickstart.cmd The starter ends with pause, so a window that a double click opened stays open until you press a key.
Linux
./quickstart At the end the starter waits for Enter only when its input is a terminal.
The exit status is 0 when every step ended with the status that the demo expects, and 1 when a step ended with another. It is 2 when the folder of the demo exists already or cannot be created, or when an error of the operating system ends a step, and 130 when you stop the demo with Ctrl+C.
The options of quickstart:
-
Without waiting
--no-pauseThe demo does not wait for Enter before each step.
-
The language
--langThe language of the texts,
deoren. Without it the demo speaks the language of the system. -
Shared options
--repositories. They are described under Options that several commands share.
The files of quickstart:
Reads
-
The history of the model
delib-history/The two revisions of the quick start.
-
The tolerance profile
tolerance-bruttobeitrag.jsonIn the folder
profiles/of the package.
Writes
-
The folder of the demo
quickstart-<UTC time>/A new folder in
runsin the package folder. The demo names it at the start and at the end. -
The regression
regression/What
regressionwrites, with the run of the state N+1 in its folderrun/. -
The change manifest
changes.jsonWhat
derivewrites. -
The search
search/What
searchwrites.
If something goes wrong in this section
Options that several commands share
Six options mean the same in every command that takes them. The section of a command names those that it takes.
-
The tolerance profile
--toleranceA file in JSON that sets for each quantity how far a value may deviate. Without it the comparison is exact: there is no tolerance profile that holds by default. The package holds one in its folder
profiles/,tolerance-bruttobeitrag.json: it lets a change of the Bruttobeitrag of at most one cent per model point and month pass and compares every other quantity exactly.comparetakes the tolerance profile of its request. -
The number of worker processes
--workersHow many processes project the model points of a state at the same time: a whole number of at least 1. Without it the number is the one that the environment variable
DELTARECON_WORKERSnames, else one per processor. The number changes no file that a command writes. -
The engine
--engineThe engine to load, as
MODULE:CLASS. Without it the command takes the engine that the environment variableDELTARECON_ENGINEnames, else the reference model. -
The folder of the engine
--engine-pathA folder that is put on the import path before the engine is loaded, so that a module in it can be named. Without
--engineand without this option the command takes the folder thatDELTARECON_ENGINE_PATHnames. -
An option of the engine
--engine-optionAn option that the engine reads, as
KEY=VALUE. You may give it several times, each key once. The reference model takes the keypathalone, the way it computes:path=export, the default, through the export of the model that modelx writes, orpath=modelx, through modelx itself. A run never falls back to the other way. -
The folder of the histories
--repositoriesThe folder that holds what the engine restores a release from; for the reference model the folder that holds
delib-history. In the package the launcher sets it to the package folder, so you need not give it.
Hint
The engine options are for an engine of your own
Without --engine and without the variable DELTARECON_ENGINE every command computes with the reference model, and you need none of the three engine options to follow this page. With an engine of your own, DeltaRecon reaches it through its adapter, which --engine and --engine-path select. What your engine must provide describes what an engine has to provide.