httk.atomistic.structure_entries¶
An EntryProvider serving OPTIMADE structures from httk-atomistic.
StructureEntryProvider maps Structure objects to
the neutral httk-core entry-provider contract, so a serving module (such as
httk-optimade) can expose them as an OPTIMADE structures endpoint without
this module depending on the serving module. The served entry type is described
by the vendored OPTIMADE standard structures definition (loaded via
httk.core.load_entry_type_definition()).
Beyond the core structural fields, the provider auto-derives the standard
composition fields (nperiodic_dimensions, dimension_types,
elements_ratios, chemical_formula_reduced / _anonymous /
_descriptive) for ordered structures, may serve custom database-specific
properties layered on via an
extended() definition, and may map an entry
id to None (a known entry with no structure — structural columns serve
null).
Classes¶
Serves OPTIMADE |
Module Contents¶
- class httk.atomistic.structure_entries.StructureEntryProvider(entries: collections.abc.Mapping[str, httk.atomistic.structure_like.StructureLike | None], *, extra_definitions: collections.abc.Mapping[str, httk.core.PropertyDefinition] | None = None, properties: collections.abc.Mapping[str, collections.abc.Mapping[str, Any]] | None = None)[source]¶
Bases:
httk.core.EntryProviderServes OPTIMADE
structuresfrom a mapping of id to structure.entriesmaps each entry id to aStructure(or any structure exposing thecell/sites/species/species_at_sitesquartet, or a(cell, sites, species, species_at_sites)tuple), or toNonefor a known entry that has no structure (its structural columns then serve null).The always-served structural fields are
id,type,nsites,elements,nelements,species(as OPTIMADE species dicts),species_at_sites,lattice_vectors(the cell basis rows),cartesian_site_positions(reduced coordinates times the cell basis), andstructure_features(disorderwhen any species mixes several chemical symbols;site_attachmentswhen any species has attached atoms). The standard composition fieldsnperiodic_dimensions,dimension_types,elements_ratios,chemical_formula_reduced/_anonymous/_descriptiveare auto-derived for a fully ordered structure (every species a single, unattached element), else served as null.extra_definitionsextends the served entry-type definition with custom database-specific properties (each carrying a registered prefix), andpropertiessupplies their per-entry values as{entry_id: {name: value}}; every property named there MUST be described by the (extended) definition (aValueErrorat construction names any offender), and a value absent for an entry is served as null.- entry_types() collections.abc.Mapping[str, httk.core.EntryTypeDefinition][source]¶
- records(entry_type: str) collections.abc.Iterable[collections.abc.Mapping[str, Any]][source]¶