Documentation

2.5 Upgrading and keeping several versions

A new version arrives because the program changed. Upgrading is a small routine, and the habit that makes it safe is to keep the old version until the work done with it is closed.

2.5.1 Why old executables are kept

To reproduce an analysis you need the program that ran it (Section 1.1). The output folders record the version that wrote them, but only the executable of that version can run the analysis again. Keep, for each analysis that matters, the output folders, the settings files and the executable (or its archive, with the checksum) of the version. Never overwrite or delete the archive of an earlier version.

A practical layout for several versions on one computer is one folder per version, each holding one executable:

tools/nlmx/
├── 4.1.0/nlmx
├── 4.2.0/nlmx
└── 4.2.1/nlmx

Call the one you want by its path, or point a variable at it (NLMX=tools/nlmx/4.2.1/nlmx), as the tour script of Chapter 3 does. Nothing is shared between versions: there is no registry, no cache and no user-level settings.

2.5.2 Reading the CHANGELOG

CHANGELOG.md lists every release, newest first, with the date and a few bullets for each change in the user's terms. At the time of this book it holds 53 entries. Read it from the top to the version you run, looking for three things.

  • Changed defaults. The entry says so in bold. For example, version 4.2.0 changed where power takes the estimates from: with no option it now uses the final estimates written in the control stream, and no longer picks up a .ext lying beside it.
  • Renamed or removed items. run became cov in 3.8.0 (the old name still works); the program was renamed to nlmx in 3.1.0.
  • Fixes that touch your results. Version 4.2.1 fixes --covariates for qc-data, qc-nm, eda, nca and er, which had stopped with an error; version 4.2.0 corrected the chi-square critical value used by power.

The version number tells you how much to read (Section 2.1.1): a patch release rarely affects results; a minor release adds or changes defaults; a major release changes settings or outputs.

2.5.3 Checking settings across major versions

Settings files are the part of a project most affected by a major version, because an old file may name keys that no longer exist, or carry an extension that is no longer accepted. The program does not guess: it refuses the file and says what to change (Section 1.3.1). Two major changes are good examples.

Version Change What you do with an old project
2.0.0 the [data], [model] and [[parameters]] tables were removed: the model is read from the control stream delete those tables; a configuration that still has one is rejected with a hint
4.0.0 each command's settings file has its own extension (.covar, .eda, .nca, …) rename the file (nlmx.txt becomes nlmx.covar); the content is unchanged

A safe upgrade of a live project is therefore: install the new version beside the old one; run nlmx <command> --print-config new_template.<ext> for the commands you use and compare it with your settings file; re-run one finished analysis with the new version and compare the key numbers with the old output folder (Chapter 4 explains what may differ); and only then switch.

2.5.4 A short upgrade routine

  1. Read the CHANGELOG between your version and the new one.
  2. Install the new version in its own folder; run nlmx version and the smoke test of Section 2.4.
  3. Re-run a closed analysis; compare.
  4. Update the validation record: version and checksum.
  5. Keep the old version until the analyses done with it are closed.

Common mistakes

  • Running whatever nlmx is first on the PATH. After an upgrade, which nlmx (where nlmx on Windows) can still point to the old copy. Run nlmx version and read the version before you start.
  • Deleting the old executable to save space. It is small. Keep it.
  • Copying a settings file between commands. The extension carries meaning; a .vpc file is not a .eda file, even though both are TOML.

Checklist for Chapter 2

  • nlmx version --no-color shows the version I intended to install.
  • I have the SHA-256 of the archive or the executable, and it matches the published value.
  • The smoke test of Section 2.4.3 passes: qc-data ends with 99 checks and no failure, fit ends with OFV −2880.2130.
  • The previous version is still available, and I know which analyses used it.

Further reading

  • Next: Chapter 3, a first hour with nlmx, runs the demo project through the whole workflow.
  • Conventions that every command shares (folders, seeds, exit codes): Chapter 4.
  • Settings files and their extensions: Chapter 7 and Chapter 37; the output files of every command: Chapter 38.
  • Errors and exit codes: Chapter 39.