Datasources
A datasource reads raw structures and spectra and exposes them to dataset preparation.
XANESNET accepts both molecular and periodic structures through the common DataSource interface.
The loaded data are passed to Datasets for preparation.
Available implementations
The datasource_type field selects one of the registered datasource types.
pmgjson(PMGJSONSource) reads pymatgen JSON files from one directory.multipmgjson(MultiPMGJSONSource) reads pymatgen JSON files from multiple subdirectories.xyzspec(XYZSpecSource) reads paired.xyzstructure files and spectrum files.multixyzspec(MultiXYZSpecSource) reads paired files from multiple subdirectories.
Important notes
For the PMGJSON sources, spectrum_key is the pymatgen site-property key containing the spectrum.
Its default is spectrum; use a different value when the source data use a key such as XANES.
In general, one can use whichever datasource is convenient, as they provide a common interface. However, when training for example the multi-head models, one must ensure that a “multi” datasource is used.
Examples
PMGJSON:
datasource:
datasource_type: pmgjson
json_path: ./data/toy_data/
spectrum_key: "XANES"
XYZSpec:
datasource:
datasource_type: xyzspec
xyz_path: ./data/toy_data/
spectra_path: ./data/toy_data/
API reference
See also xanesnet.datasources and the schemas under xanesnet/schemas/datasources/ for complete constructor fields and defaults.