emmet.core.types.typing

Define custom type annotations for emmet-core.

Note that only type annotations which are used across the code base should be put here.

Types which only have one purpose / exist only within one module, can and should remain in that module.

Module Attributes

FSPathType

Type of a generic path-like object

DateTimeType

Datetime serde.

NullableDateTimeType

Nullable datetime serde.

MaterialIdentifierType

MPID / AlphaID serde.

JsonDictType

Annotation for free-form JSON-like dict (INCAR-like, ddec6, etc.)

JsonListType

Annotation for free-form JSON-like list (some custodian metadata)

Functions

format_compound_identifier

Render a composite MP identifier in the requested format, preserving the suffix.

format_identifier

Render an MP identifier as either the legacy mp-<int> form or the padded AlphaID form.

format_task_id

Render a calculation task id in either legacy or new alpha form.

validate_compound_identifier

Serde for compound identifier types.

Classes

CompoundIDType

Define layout of compound identifiers for static type analysis.

ID_PADLEN

int([x]) -> integer int(x, base=10) -> integer

ID_PREFIX

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str