httk.core.loading¶
Dispatch file loaders and optional domain adapters.
load retains the neutral loader result when no domain adapter owns its
format, while installed capability modules can register adapters to provide a
one-call domain-loading experience. Callers that need the neutral payload can
use raw=True.
Functions¶
|
Load |
Module Contents¶
- httk.core.loading.load(filename: str, *, raw: bool = False, **kwargs: Any) Any[source]¶
Load
filenameand adapt its neutral payload to a domain object.Dispatch strips at most one recognized compression suffix (
.gz,.bz2, …) to obtain an inner name, then selects a loader by that inner name’s extension (.cif,.poscar, …) or, failing that, by its exact basename (POSCAR,CONTCAR; case-insensitive). The selected loader always receives the originalfilename; loaders open it through the datastream layer, which transparently decompresses. By default, a mapping with a string"format"tag is passed to the registered domain adapter for that format.raw=Trueis the neutral-payload escape hatch. Payloads with unknown formats, and non-mapping loader results, pass through unchanged.