xnn.common.data.ase_io#

Read ASE-native structure data (extxyz, CIF, VASP, …) into xnn.

ase.io.read already understands every common atomistic file format; the helpers here convert its Atoms objects into the plain structure dicts that structure_to_graph() and AtomicDataset consume. Training targets (energy, forces, stress) are taken from the frame’s calculator when present – ase.io.read attaches a SinglePointCalculator for formats that store them, e.g. extxyz – with atoms.info / atoms.arrays as a fallback.

ASE is an optional dependency (pip install xnn[ase]), so it is imported lazily inside the functions.

Functions

atoms_to_structure(atoms[, energy_key, ...])

Convert one ASE Atoms object to an xnn structure dict.

load_structures(path[, index])

Load a structure file into the list-of-dicts format the dataset expects.