structures¶
StructureMapper (BaseResourceMapper)
¶
Source code in optimade/server/mappers/structures.py
class StructureMapper(BaseResourceMapper):
LENGTH_ALIASES = (
("elements", "nelements"),
("elements_ratios", "nelements"),
("cartesian_site_positions", "nsites"),
("species_at_sites", "nsites"),
)
ENTRY_RESOURCE_CLASS = StructureResource
ENTRY_RESOURCE_CLASS (EntryResource)
pydantic-model
¶
Representing a structure.
Source code in optimade/server/mappers/structures.py
class StructureResource(EntryResource):
"""Representing a structure."""
type: str = StrictField(
"structures",
description="""The name of the type of an entry.
- **Type**: string.
- **Requirements/Conventions**:
- **Support**: MUST be supported by all implementations, MUST NOT be `null`.
- **Query**: MUST be a queryable property with support for all mandatory filter features.
- **Response**: REQUIRED in the response.
- MUST be an existing entry type.
- The entry of type `<type>` and ID `<id>` MUST be returned in response to a request for `/<type>/<id>` under the versioned base URL.
- **Examples**:
- `"structures"`""",
regex="^structures$",
support=SupportLevel.MUST,
queryable=SupportLevel.MUST,
)
attributes: StructureResourceAttributes