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)[source]¶
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()[source]¶
Resolve and return the memoized native structure.
- Returns:
The parsed native structure.
- Return type:
- property cell: httk.atomistic.models.cell.cell.Cell[source]¶
Expose the source structure’s cell.
- Returns:
The resolved cell.
- Return type:
- property sites: httk.atomistic.models.sites.sites.Sites[source]¶
Expose the source structure’s sites.
- Returns:
The resolved sites.
- Return type:
- property species: tuple[httk.atomistic.models.species.species.Species, Ellipsis][source]¶
Expose the source structure’s species.
- Returns:
The resolved distinct species.
- Return type:
tuple[httk.atomistic.models.species.species.Species, Ellipsis]
- property species_at_sites: tuple[str, Ellipsis][source]¶
Expose the species occupying each resolved site.
- property site_moments: httk.atomistic.models.moments.backend.SiteMomentsBackend | None[source]¶
Expose optional moments from the resolved structure.
- Returns:
Site moments, or
Nonewhen they are unstated.- Return type:
httk.atomistic.models.moments.backend.SiteMomentsBackend | None