httk.atomistic.entries.structures

Project atomistic structures onto the neutral OPTIMADE entry-provider contract.

Classes

StructureEntry

Define the non-instantiable OPTIMADE structure entry family.

StructureEntryProvider

Serve complete OPTIMADE v1.3 structure records from atomistic structures.

Module Contents

class httk.atomistic.entries.structures.StructureEntry[source]

Define the non-instantiable OPTIMADE structure entry family.

type = 'structures'[source]
definition_id = 'https://schemas.optimade.org/defs/v1.3/entrytypes/optimade/structures'[source]
classmethod entry_type_definition()[source]

Load the standard structure definition with atomistic extensions.

Returns:

The extended OPTIMADE structures definition.

Return type:

httk.core.EntryTypeDefinition

class httk.atomistic.entries.structures.StructureEntryProvider(entries, *, extra_definitions=None, properties=None)[source]

Bases: httk.core.EntryProvider

Serve complete OPTIMADE v1.3 structure records from atomistic structures.

A mapping keeps the convenient {"example": structure} form and its explicit served ids. An iterable of natural structures uses each representation’s structural content id. Entry metadata lives on the structures themselves.

Custom properties may extend the schema, but standard OPTIMADE fields are a pure projection of the entry and structure and cannot be replaced by custom values.

Parameters:
entry_types()[source]

Return the structure entry type served by this provider.

Returns:

The structures entry-type definition.

Return type:

collections.abc.Mapping[str, httk.core.EntryTypeDefinition]

property_keys(entry_type)[source]

Map served structure properties to storage keys.

Parameters:

entry_type (str) – The entry type to inspect.

Returns:

Served-property to storage-key mappings.

Raises:

KeyError – If entry_type is not structures.

Return type:

collections.abc.Mapping[str, str]

records(entry_type)[source]

Project the provider’s structures into OPTIMADE records.

None entries produce rows with null structure properties.

Parameters:

entry_type (str) – The entry type to project.

Returns:

The projected records.

Raises:

KeyError – If entry_type is not structures.

Return type:

collections.abc.Iterable[collections.abc.Mapping[str, Any]]