Skip to content

Migrating from 0.15.x to 1.0.0 ​

Historical guide. This page covers the 0.15 → 1.0 transition. Upgrading from 1.x to 2.0? Read Migrating to 2.0 for the typed error change and the core promotions.

sci-form 1.0.0 is the first stable release. It closes three exhaustive audits (100 findings in reports/auditoria-total.md, 88 blockers in reports/v1.0-blockers.md).

Almost everything in this guide is additive: the deprecated names still work, they just warn. The genuinely breaking changes are the ones where a function that used to panic now returns a Result, because a library that crashes on a malformed molecule is not a library you can ship.


The 60-second version ​

If youDo this
Call a Python functionNothing. Every old name still works, with a DeprecationWarning.
Call a Rust function that used to panicAdd ? (or .unwrap()) — see Rust below.
match on a public enumAdd a _ => arm. 57 enums are now #[non_exhaustive].
Use the CLIStop passing "" / "[]" / 0.0 to mean "absent".
Compare energies across methodsRead the units section. This one can silently change your answer.
Compare total_energy between PM3 and SCFStop. One is eV, the other is Hartree.
Use pm3-gradient / xtb-gradient or NEB/MD with pm3 / xtbRe-run. The values changed (they were wrong) — see Gradients.

Rust ​

Functions that now return a Result ​

These used to panic on bad input. They returned Result<_, String> in the 1.0 API; the 2.0 root API returns Result<_, SciFormError>. See Migrating to 2.0.

FunctionBeforeAfter
sci_form::embed_batchVec<ConformerResult>Result<Vec<ConformerResult>, String>
sci_form::dos::compute_dosDosResultResult<DosResult, String>
sci_form::dos::compute_pdosPdosResultResult<PdosResult, String>
sci_form::eht::evaluate_orbital_on_gridVec<f64>Result<Vec<f64>, String>
sci_form::eht::evaluate_orbital_on_grid_parallelVec<f64>Result<Vec<f64>, String>
sci_form::eht::volume::compute_grid_extents([f64; 3], [usize; 3])Result<([f64; 3], [usize; 3]), String>
sci_form::eht::volume::evaluate_orbital_on_grid_chunkedVec<f64>Result<Vec<f64>, String>
sci_form::eht::volume::evaluate_density_on_gridVec<f64>Result<Vec<f64>, String>
sci_form::xtb::gfn0::gfn0_repulsionf64Result<f64, String>
sci_form::xtb::gfn0::gfn0_eeqVec<f64>Result<Vec<f64>, String>
sci_form::xtb::gfn0::gfn0_h0Vec<f64>Result<Vec<f64>, String>
sci_form::scf::uhf::run_uhfUhfResultResult<UhfResult, String>
sci_form::scf::uhf::run_uhf_parallelUhfResultResult<UhfResult, String>
sci_form::scf::uhf::run_rohfUhfResultResult<UhfResult, String>
sci_form::materials::simulate_powder_xrdVec<f64>Result<Vec<f64>, String>
sci_form::ml::compute_3d_descriptorsVec<f64>Result<Vec<f64>, String>
sci_form::compute_ir_spectrum_broadenedIrSpectrumResult<IrSpectrum, String>
sci_form::materials::Topology::from_nameOption<Topology>Result<Topology, String>
sci_form::compute_nonpolar_solvationNonPolarSolvationResult<NonPolarSolvation, String>
sci_form::compute_gb_solvationGbSolvationResult<GbSolvation, String>
sci_form::compute_alpb_solvationAlpbResultResult<AlpbResult, String>
sci_form::solvation::compute_gb_solvationGbSolvationResult<GbSolvation, String>
sci_form::solvation::compute_nonpolar_solvationNonPolarSolvationResult<NonPolarSolvation, String>
sci_form::solvation::compute_born_radiiVec<f64>Result<Vec<f64>, String>
sci_form::solvation_alpb::compute_alpb_solvationAlpbResultResult<AlpbResult, String>
sci_form::solvation_alpb::compute_born_radiiAlpbBornRadiiResult<AlpbBornRadii, String>

The solvation family is in this table because a zero dielectric constant used to divide by zero and return a NaN energy, and a charge vector shorter than the atom list used to index past its end and abort the process. Both are now errors. ε = 1.0 (the vacuum limit) and a zero probe radius (the plain van der Waals surface) are still valid inputs.

rust
// 0.15
let mesh = sci_form::eht::evaluate_orbital_on_grid(&basis, &coeffs, 0, &pos, 0.2, 3.0);

// 1.0
let mesh = sci_form::eht::evaluate_orbital_on_grid(&basis, &coeffs, 0, &pos, 0.2, 3.0)?;

New try_* variants ​

Every remaining panic-on-bad-input entry point now has a fallible sibling. The infallible one still exists and still panics, so nothing breaks — but you should prefer the try_* form in new code.

Infallible (panics)Fallible (new)
scf::types::MolecularSystem::from_angstrom::try_from_angstrom
scf::types::MolecularSystem::from_flat_angstrom::try_from_flat_angstrom
scf::scf_loop::run_scf::try_run_scf
spectroscopy::hessian::compute_hessian::try_compute_hessian
spectroscopy::hessian::compute_hessian_parallel::try_compute_hessian_parallel
spectroscopy::ir_intensities::compute_ir_intensities::try_compute_ir_intensities
spectroscopy::stda_uvvis::compute_stda::try_compute_stda
ani::neighbor::CellList::new::try_new
alignment::compute_rmsd::try_compute_rmsd
alignment::align_coordinates::try_align_coordinates
alignment::align_quaternion::try_align_quaternion
gpu::context::GpuContext::new::try_create

Renamed root functions (old names are deprecated aliases) ​

The non-idiomatic get_ prefix is gone.

rust
// 0.15
let support = sci_form::get_eht_support(&elements);

// 1.0
let support = sci_form::eht_support(&elements);
DeprecatedCanonical
get_eht_supporteht_support
get_system_capabilitiessystem_capabilities
get_system_method_plansystem_method_plan

The old names still compile and emit a deprecation warning.

New at the crate root ​

rust
let r = sci_form::compute_gfn1(&elements, &positions)?;   // GFN1-xTB
let r = sci_form::compute_gfn2(&elements, &positions)?;   // GFN2-xTB

#[non_exhaustive] on the public enums ​

57 of the 60 public enums are now #[non_exhaustive]. A downstream match must have a wildcard arm:

rust
// 0.15
match method { DosMethod::Tetra => .., DosMethod::Gauss => .. }

// 1.0
match method {
    DosMethod::Tetra => ..,
    DosMethod::Gauss => ..,
    _ => ..,   // required: the variant set may grow
}

Three enums were deliberately not marked, because their variant set is a published taxonomy rather than an extensible API: Mmff94AtomType (it mirrors the fixed MMFF94 atom-type list), ConformerSearchStatus (a lifecycle enum) and Mmff94BondType.

New result fields ​

All additive, so struct literal construction still works if you use ..:

StructFieldMeaning
pm3::Pm3Resultnotes: Vec<String>e.g. "the faithful solver failed, fell back to the legacy path"
xtb::XtbResultnotes: Vec<String>e.g. "the GPU path was unavailable, the CPU was used"
ir::VibrationalAnalysisn_imaginary_modes: usizenumber of imaginary (negative) frequencies
alignment::AlignmentResulterror: Option<String>the reason the alignment failed
scf::types::ScfResulterror: Option<String>the reason the SCF did not converge
hf::cis::CisResulterror: Option<String>the reason the CIS did not converge

AlignmentResult also gained is_valid() and AlignmentResult::INVALID_RMSD (the sentinel f64::NAN replaced by an explicit invalid value).


Python ​

Nothing breaks. Every old name still works and emits a DeprecationWarning that names its replacement.

python
import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)   # opt out

The canonical names ​

The canonical name of a capability is now the Rust root function name, and every action is a compute_* / analyze_* / predict_* verb. The *_calculate suffix had no precedent in RDKit, PySCF, ASE or xtb and is gone.

DeprecatedCanonical
chargescompute_charges
sasacompute_sasa
populationcompute_population
dipolecompute_dipole
compute_espcompute_esp_grid
doscompute_dos
bond_orderscompute_bond_orders
frontier_descriptorscompute_frontier_descriptors
fukui_descriptorscompute_fukui_descriptors
reactivity_rankingcompute_reactivity_ranking
uff_energycompute_uff_energy
mmff94_energycompute_mmff94_energy
empirical_pkacompute_empirical_pka
ml_descriptorscompute_ml_descriptors
ml_predictpredict_ml_properties
nmr_shiftscompute_nmr_shifts
nmr_couplingscompute_nmr_couplings
nmr_spectrumcompute_nmr_spectrum
giao_nmrcompute_giao_nmr
hose_codescompute_hose_codes
ir_spectrumcompute_ir_spectrum
vibrational_analysiscompute_vibrational_analysis
gb_solvationcompute_gb_solvation
alpb_solvationcompute_alpb_solvation
nonpolar_solvationcompute_nonpolar_solvation
pm3_calculatecompute_pm3
xtb_calculatecompute_xtb
gfn1_calculatecompute_gfn1
gfn2_calculatecompute_gfn2
hf3c_calculatecompute_hf3c
ani_calculatecompute_ani
eht_calculatecompute_eht

The full table of 94 aliases is in crates/python/src/naming.rs and the canonical list, grouped by capability, is sci_form.__all__.

Class names lost the Py suffix ​

The suffix existed only to avoid a Rust name clash; it never helped the Python caller.

python
# 0.15
sci_form.ChargeResultPy
sci_form.EhtResultPy
sci_form.SasaResultPy

# 1.0
sci_form.ChargeResult
sci_form.EhtResult
sci_form.SasaResult

parse returns an object, not a dict ​

python
# 0.15
mol = sci_form.parse("CCO")
mol["num_atoms"]        # dict access

# 1.0
mol = sci_form.parse("CCO")
mol.num_atoms           # attribute access

The error taxonomy ​

ExceptionWhen
ValueErroryour input is malformed (a bad SMILES, a length mismatch, an unknown method name)
RuntimeErrorthe engine failed (the SCF did not converge, the GPU was unavailable)
NotConvergedErrorspecifically a non-convergence (a subclass of RuntimeError)
python
from sci_form import NotConvergedError

try:
    sci_form.compute_scf(elements, coords)
except NotConvergedError:
    ...   # tighten the SCF, or accept the `notes`
except ValueError as e:
    ...   # fix your input

cpm_charges was being computed at the wrong potential ​

The Python module registered cpm_charges twice; the second registration (β tier, μ = 0.0 eV) silently won over the first (μ = −4.44 eV, the standard H⁺/H₂ electrode potential). In 1.0 the β copy is beta_compute_cpm_charges and cpm_charges is the standard one.

python
sci_form.cpm_charges(elements, coords)              # mu = -4.44 eV (correct)
sci_form.beta_compute_cpm_charges(elements, coords)  # mu = 0.0 eV (the beta tier)

Both live behind the CPM feature flag (experimental-cpm, or its modern equivalent beta-cpm), so they are absent from a default build.

Zero-copy entry points ​

Two functions write into a caller-owned float64 buffer instead of copying the data across the FFI boundary:

python
import numpy as np

buf = np.empty(3 * n_atoms)
sci_form.embed_coords_into("CCO", buf, seed=42)

Use them for a volumetric grid or a long trajectory; for a single molecule the copy is irrelevant.

Options mappings ​

The eight worst-over-argumented functions (optimize_framework had 14 parameters) accept an optional options= mapping. The positional form still works.

python
sci_form.optimize_framework(smiles, coords, options={"max_steps": 200, "forcefield": "uff"})

TypeScript / WASM ​

The canonical names ​

Same rule: the Rust root name is canonical. The old WASM names still work.

*_seed64 ​

The 32-bit seed argument silently truncated a 64-bit hash, so "the same seed" gave a different conformer ensemble in JS and in Rust. Every seeded function now has a _seed64 variant that takes a bigint.

ts
import { embedConformerSeed64 } from "sci-form-wasm";

const out = embedConformerSeed64("CCO", coords, 42n);

The 32-bit variants are kept for compatibility.

parse_smiles returns the atoms array ​

It used to return only the counts. It now matches Python's parse.

The error payload is always valid JSON ​

ts
const raw = computeDose(elements, coords);
// '{"error":"..."}' — always parseable
const parsed = JSON.parse(raw);

CLI ​

One sentinel convention ​

An optional argument is now simply absent. The old sentinels ("", "[]", 0.0 meaning "engine default", None) are gone.

bash
# 0.15 — "" meant "no coordinates"
sci-form stereo --smiles "C[C@H](N)C(=O)O" --coords ""

# 1.0 — just omit the flag
sci-form stereo --smiles "C[C@H](N)C(=O)O"

One error-message style ​

<What failed> '<actual value>'. Supported: 'a', 'b', 'c'.

The message always quotes the offending value, always lists the valid values, and never leaks a Rust internal name, a None, or a NaN.

The developer binaries are gone from the install ​

cargo install sci-form used to install 28 executables on your $PATH (benchmark, test_eigen, test_failures, check_grad, print_c_eri, …). Only the sci-form CLI is installed now. The sources remain in the repository if you want to build them.


The 3D reaction path is not in the bindings ​

sci_form.alpha.compute_reaction_dynamics_3d, the WASM compute_reaction_dynamics_3d / compute_approach_dynamics and the CLI command reaction-dynamics3d are removed: the alpha-reaction-dynamics feature now exists only in the Rust crate. Use the stable compute_reaction_dynamics (1D coordinate), the simplified NEB or the GSM tools, or call the Rust module directly.

Units ​

This is the section that can silently change your answer.

Before 1.0, total_energy meant three different things:

Result structtotal_energy is
DftResult, D4Result, ScfResult, UhfResultHartree
Pm3Result, XtbResult, Gfn1Result, Gfn2ResulteV
AlpbResultkcal/mol

Comparing two of them was off by 27.2× (eV → Hartree) or 23.06×.

1.0 does not rename the fields — that would break every script at once. Instead:

  • Every result field now states its unit in the rustdoc, and the crate header carries a per-method unit table.
  • The _ev / _hartree / _kcal_mol suffix convention is used for every new field.

If you compare across methods, convert explicitly:

rust
const HARTREE_TO_EV: f64 = 27.211386245988;
let pm3_ev = pm3.total_energy;                    // already eV
let scf_ev = scf.total_energy * HARTREE_TO_EV;     // Hartree -> eV

And note the related trap the audit found: Hf3cResult.homo_energy, lumo_energy, gap and orbital_energies are Hartree, even though they were documented as eV in 0.15.


Gradients and the meaning of xtb ​

Numerical results changed here, on purpose.

  • compute_pm3_gradient and compute_xtb_gradient (every surface) used to return forces that did not belong to the energy they were sold with: up to 18 eV/Å off for PM3 and 209–263 eV/Å off for xTB. They are now central differences (5·10⁻⁴ Å) of the energy that compute_pm3 / compute_xtb return, so they agree with it to about 10⁻⁴ eV/Å. Anything computed with the old values — NEB/MD/reaction-dynamics paths with the pm3 or xtb backend, geometry relaxations driven by them — should be re-run. The cost is 6·N SCF runs per gradient. Details: PM3 and xTB gradients.
  • xtb / compute_xtb / sci-form xtb is GFN2-xTB and always was; the documentation called it GFN0. Its numbers equal gfn2. xtb::solve_gfn0 (Rust only) is the faithful GFN0.
  • Behaviour change: in NEB, MD and reaction dynamics the backend name "xtb" (and the legacy "gfn0" spellings) now selects GFN2, as it already did in GSM and compute_xtb. It used to select a simplified model (xtb::solve_xtb) whose absolute energies were unrelated to GFN2 (+9117 vs −7146 kcal/mol for ethanol). NebBackend::Xtb no longer exists (NebBackend::from_method("xtb") returns Gfn2; JSON "xtb" still deserialises). Re-run any path computed with xtb.
  • compute_semianalytical_hessian is now a double finite difference; prefer compute_numerical_hessian.
  • The PM3 SCF of the MOPAC-parity solver converges with Pulay DIIS. Energies agree with the previous ones to ≲ 10⁻⁵ eV (1·10⁻⁷ on H₂O₂, 4·10⁻⁶ on ethanol); scf_iterations is lower (ethanol: 32 → 20).
  • Python: embed() of an invalid SMILES raises ValueError (unchanged since the 1.0 candidates); embed_batch still returns one result per input, with the failure in .error. parse() returns a ParseResult object.

Packaging ​

  • The published crate is 339 files / 7.7 MiB (was 612 / 20.6 MiB).
  • The 27 developer binaries are no longer installed by cargo install sci-form.
  • The MSRV is now declared: Rust 1.87.
  • cargo install sci-form-cli no longer compiles nalgebra (it is behind the alpha-periodic-linear feature).

See also ​

Released under the MIT License.