httk.atomistic.models.structure.datastream¶
Lazy structure loading from files, URLs, and open text streams.
Classes¶
Represent a structure source parsed only when its data is first accessed. |
Module Contents¶
- class httk.atomistic.models.structure.datastream.DatastreamStructure(obj, **hints)¶
Bases:
httk.atomistic.models.structure.backend.StructureBackendRepresent a structure source parsed only when its data is first accessed.
Requests are intentionally reader-only: an OPTIMADE-shaped Request is declined so its headers are never lost by replacing it with
fetch(url). Open streams are one-shot sources; a failed parse is not cached, but consumed data cannot be replayed. Network URL strings require core network consent; wrapping a URL inDatastreamURLsupplies that consent explicitly.- Parameters:
obj (Any) – A path, URL, stream, request, or core datastream source.
**hints (Any) – Backend-selection and reader-name hints.
- resolve()¶
Resolve and return the memoized native structure.
- Returns:
The parsed native structure.
- Return type:
- property cell: httk.atomistic.models.cell.cell.Cell¶
Expose the source structure’s cell.
- Returns:
The resolved cell.
- Return type:
- property sites: httk.atomistic.models.sites.sites.Sites¶
Expose the source structure’s sites.
- Returns:
The resolved sites.
- Return type:
- property species: tuple[httk.atomistic.models.species.species.Species, Ellipsis]¶
Expose the source structure’s species.
- Returns:
The resolved distinct species.
- Return type:
tuple[httk.atomistic.models.species.species.Species, Ellipsis]
- property site_moments: httk.atomistic.models.moments.backend.SiteMomentsBackend | None¶
Expose optional moments from the resolved structure.
- Returns:
Site moments, or
Nonewhen they are unstated.- Return type:
httk.atomistic.models.moments.backend.SiteMomentsBackend | None
- property charge: Any¶
Expose the resolved structure’s assigned charge.
- Returns:
The assigned charge, or
Nonewhen it is unstated.- Return type:
Any
- unwrap()¶
Return the original lazy source.
- Returns:
The path, URL, request, or stream supplied at construction.
- Return type:
Any