Skip to content

Dependency replacement map ​

Task 0.10: every Python dependency Crystal-Builder uses for the headless core must have a pure Rust replacement or a documented decision before its phase starts. The survey below was run on Crystal-Builder commit 78d5476fd9e851fda00cde57b7ab8da3195dcf54.

Survey (Task 0.10.1) ​

DependencyModules that import itUsed for
gemmicore/elements.py, core/spacegroup.py, io/cif_reader.py, io/shelx.py, analysis/pxrd.py, analysis/rcsr.py, analysis/netsearch.py, powder/bridge.pyCIF and SHELX parsing, space-group tables, scattering factors, net search
spglibcore/symmetry.py, core/supercell.py, core/subgroups.pysymmetry detection, standard cells, subgroup reference
numpymost of xtal/arrays and vectorised geometry
scipycore/neighbors.py, analysis/{grid,kpath,voids}.py, build/{clearance,fill}.py, carbon/*, fullerene/geometry.py, ff/ewald.py, polymer/*, mof/pormake/*k-d trees, Voronoi, sparse grids, L-BFGS, special functions
asemof/pormake/{building_block,framework,local_structure,neighbor_list,topology,utils}.pyAtoms, neighbour lists and I/O inside the vendored PORMAKE
phonopyff/phonons.py (lazy import; find_spec probe)symmetry-reduced displacements, phonon mesh and thermodynamics
rdkitbuild/chem.py (lazy import in one module)SMILES, embedding and sketcher chemistry
rietxpowder/bridge.pypeak fitting, indexing, Pawley and Rietveld
matplotlibview/colormaps.py (sampled tables, no import at draw time)colormap samples

Decisions (Task 0.10.2) ​

DependencyRust planPhase
gemmiOwn CIF parser (sci-form port); moyo tables for space groups; own scattering-factor data1, 2, 5
spglibmoyo for detection and standardization; own subgroup enumeration only if moyo's API is insufficient2
numpynalgebra 0.35 and plain Vec<[f64; 3]>; ndarray only if a grid operation needs it1+
scipy cKDTreeOwn periodic cell list; kiddo k-d tree only if benchmarks require it1
scipy optimizeOwn L-BFGS/FIRE (sci-form port) and Levenberg-Marquardt for powder4, 7
scipy spatial.VoronoiOwn Wigner-Seitz construction by half-space intersection2
scipy sparse, ndimageOwn periodic flood fill and union-find5
ASEOwn k-path (Task 2.10), own readers, ML calculators behind the ml feature2, 3, 8
phonopyOwn displacements, force constants, phonon DOS and thermodynamics, validated against phonopy outputs4
RDKitsci-form SMILES port; embedding through the optional sci-form feature6
rietxStudy, then port the numerical kernels natively after the license check7
matplotlibColormap tables as data; plots are left to consumers3

No Python package becomes a runtime dependency of the Rust library. The Python bindings expose the same Rust engine and need NumPy only for arrays.

License check (Task 0.10.3) ​

PackageLicenseUse in xtalforgeStatus
gemmiMPL-2.0Golden-data generator only; no code portedverified, not redistributed
spglibBSD-3-ClauseGolden-data generator and audit comparison onlyverified, not redistributed
numpyBSD-3-ClauseGolden-data generator onlyverified, not redistributed
scipyBSD-3-ClauseGolden-data generator only; algorithms reimplemented from papersverified, not redistributed
ASELGPL-2.1-or-laterReference for k-paths and C60 coordinates; the tables are redistributed as derived data, no code portedverified, derived data
phonopyBSD-3-ClauseReference outputs only; the Gamma-point phonon path is nativeverified, not redistributed
RDKitBSD-3-ClauseReplaced by sci-form's MIT codeverified, not ported
rietxMIT (stated in Crystal-Builder's pyproject.toml; no license field on PyPI)Inventory only; no code or data copiedverified from the note, not redistributed
matplotlibMatplotlib license (PSF-based and BSD-compatible)Colormap anchor colours written by handverified, not redistributed

Ported code and data are recorded in THIRD_PARTY.md before they are merged. Where a license is unclear, the algorithm is reimplemented from the paper instead of copied.