mfsig.com
versionspinningreproducibilitysoftware5 min read

Pinned software versions, and why latest is not a method

A method that depends on whichever package version was installed cannot be reproduced. What to pin in a DFT pipeline and how the result file should say so.

Updated November 28, 2026

A computational method is defined by its settings and by the code that interprets them. If the code is whichever version happened to be installed, the method is undefined, and a result that cannot be attributed to a defined method cannot be reproduced. Pinning means naming an exact version of every package in the stack, installing exactly that, and recording what actually ran inside each result file. This guide covers what drifts between releases, what to pin, how to read versions at run time and when to re-pin.

What changes between two releases of a quantum chemistry package

Chemists tend to assume that a functional and a basis set define a number. They define a number to within the numerical choices of the implementation, and those choices move. A new release may change the default integration grid for the exchange-correlation term, tighten or loosen integral screening, alter the initial guess, change how a density-fitting auxiliary basis is read, or fix a bug that affected a class of molecules. Each of these moves the converged density slightly, and the screening charges on the cavity move with it.

Geometry tools move too. A conformer embedder like RDKit's ETKDG is seeded, but the sequence of random numbers a seed produces, and the way the algorithm consumes them, can change between releases. The same SMILES with the same seed can land in a different local minimum under a different RDKit version. Force field parameter files are occasionally corrected. None of these changes is wrong. All of them mean that a sigma profile computed in one year and one computed in the next may differ for no chemical reason. From SMILES to 3D explains how much of the final result the geometry step controls.

Pin the whole stack, not just the package you call

Pinning PySCF alone is a start, not a method. The numbers pass through the Python interpreter, the array library, the linear algebra backend, the GPU toolkit if one is used, the conformer tool and the force field implementation. Each has a version, and each can change a last digit or more. A floating-point sum evaluated in a different order on different hardware gives a slightly different result, which is why two correctly pinned environments on two machines can still disagree in the last digits. That is acceptable and should be stated. A disagreement you can see on a plotted σ-profile is not acceptable and usually traces to an unpinned component.

A practical pin list for a σ-profile pipeline includes the interpreter, the quantum chemistry package and any GPU extension, the cheminformatics toolkit, the numerical libraries and the container base image, by digest rather than by tag. A tag like latest or stable is a pointer that moves. A digest is a fixed identity. GPU-accelerated DFT discusses which parts of the result a hardware change can and cannot touch.

Latest is a pointer that moves. A method built on a moving pointer is not a method.

Reading versions at run time, in ten lines

Declared versions are what you planned. Observed versions are what ran. Write the observed ones. Python's standard library can read the installed version of any package while the process is running.

from importlib.metadata import version, PackageNotFoundError

def observed_versions(names):
    out = {}
    for name in names:
        try:
            out[name] = version(name)
        except PackageNotFoundError:
            out[name] = None
    return out

print(observed_versions(["pyscf", "rdkit", "numpy", "scipy"]))

Call this inside the pipeline, after imports and before the first calculation, and write the dictionary into the result file. A reader can then see that the file was produced by one named release of each package, and a None value is an honest statement that a package was not present. MFsig follows this pattern. Every .mfsig file carries the package versions read at run time, next to the method block and the content SHA-256, so the three can be checked together. The anatomy page shows where they sit.

Why the recipe version and the package versions are two different things

A recipe version names a set of scientific settings. A package version names an implementation. Both belong in the file, and they change for different reasons. MFsig's recipe v1.0.0 specifies ωB97M-V, def2-SVP, density fitting with def2-svp-jkfit, a def2 effective core potential for Z ≥ 37, C-PCM at ε = 80 with the full cavity definition, ETKDG with seed 42 and MMFF94s with a UFF fallback. That definition does not change when a package is upgraded. What changes is the implementation that executes it, and the package versions record that.

The distinction matters when results disagree. Same recipe version, different package versions, different numbers means an implementation drift to quantify. Different recipe versions means a method change to respect. The frozen atlas recipe v0.91.1, which used UFF geometries and no effective core potential, gives different σ-profiles from v1.0.0 by design, and no package upgrade would reconcile them. Versioning a recipe registry covers how to number such changes.

When to re-pin, and what to do with the old results

Re-pin deliberately, never by accident. Choose a reference set of molecules that spans the chemistry you care about. Compute it under the old pins and the new. Compare σ-moments, total areas and a distance between the raw per-segment distributions. If the shift is within the tolerance you can defend, bump the patch or minor version of your pipeline and record the comparison. If it is not, treat the new pins as a new recipe version and never mix its output with the old in one dataset without saying so.

Keep the old results. They were computed by a defined method, and they remain valid records of it. A result does not expire because a newer package exists. What expires is the assumption that two results from different environments can be compared without checking, and the version block in each file is what lets you check.

Key points

  • Latest is a pointer that moves, so a method built on it is undefined and cannot be reproduced.
  • Releases change grids, thresholds, guesses, embedding and parameter files, each of which moves screening charges.
  • Pin the whole stack by exact version and container digest, not only the package you call directly.
  • Read versions from the running process with importlib.metadata and write them into every result file.
  • Keep recipe version and package versions as separate fields, because they change for different reasons.

Questions people ask

Why do package versions matter for a DFT result?
Releases change numerical defaults such as integration grids, screening thresholds, convergence criteria and basis set data files, and sometimes fix bugs that shifted energies. Two versions of the same package given the same input can return different screening charges. Without the version, a difference between two runs cannot be attributed.
What does it mean to pin a version?
Pinning means declaring an exact version of each package, for instance pyscf equal to one specific release rather than any release above a minimum, and installing exactly that. A pinned environment can be rebuilt later. An environment that installs the latest release cannot, because latest changes meaning every few weeks.
Is a requirements file enough to record versions?
No. A requirements file records intent. The versions that actually ran can differ after a cached build, a dependency conflict or a manual upgrade. Read each version from the running process with importlib.metadata and write it into the result file, so the record describes what happened rather than what was planned.
Should I re-run old results when I upgrade?
Not by default. Keep the old results with their recorded versions and recipe version, and treat the upgraded pipeline as a new recipe version. Rerun a small reference set under both to measure the shift, publish that comparison, and only then decide whether old and new results may be mixed.

Further reading

In practice: Each .mfsig file records the method, the package versions read at run time, the geometry convergence flag and a content SHA-256, and no file is written when the SCF does not converge. The lineage and audit pages describe the record in full.

Generate a σ-profile from your SMILES

Free converter for a profile you already have, a reference-grade DFT run with its provenance record when it has to be defensible.