types¶
AnnotatedType = type(ChemicalSymbol)
module-attribute
¶
ChemicalSymbol = Annotated[str, Field(pattern=EXTENDED_CHEMICAL_SYMBOLS_PATTERN)]
module-attribute
¶
ELEMENT_SYMBOLS_PATTERN = '(' + '|'.join(CHEMICAL_SYMBOLS) + ')'
module-attribute
¶
EXTENDED_CHEMICAL_SYMBOLS_PATTERN = '(' + '|'.join(CHEMICAL_SYMBOLS + EXTRA_SYMBOLS) + ')'
module-attribute
¶
ElementSymbol = Annotated[str, Field(pattern=ELEMENT_SYMBOLS_PATTERN)]
module-attribute
¶
NoneType = type(None)
module-attribute
¶
OptionalType = type(Optional[str])
module-attribute
¶
SEMVER_PATTERN = '^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$'
module-attribute
¶
SemanticVersion = Annotated[str, Field(pattern=SEMVER_PATTERN, examples=['0.10.1', '1.0.0-rc.2', '1.2.3-rc.5+develop'])]
module-attribute
¶
UnionType = type(Union[str, int])
module-attribute
¶
__all__ = ('ChemicalSymbol', 'SemanticVersion')
module-attribute
¶
_get_origin_type(annotation)
¶
Get the origin type of a type annotation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
annotation |
type
|
The type annotation. |
required |
Returns:
Type | Description |
---|---|
type
|
The origin type. |
Source code in optimade/models/types.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|