httk.io.vasp.xdatcar¶
Lazy, lexeme-preserving readers for VASP XDATCAR files.
Classes¶
Re-openable, forward-streaming XDATCAR source. |
Functions¶
|
Read an XDATCAR path into a lazy neutral |
Module Contents¶
- class httk.io.vasp.xdatcar.XdatcarFile(filename)[source]¶
Re-openable, forward-streaming XDATCAR source.
Construction checks only that
filenameexists. Compressed paths are accepted by deliberate forward-streaming divergence fromWavecarFile; repeated scans re-stream the file. Header properties scan the header;framesopens a fresh stream and never caches frames. Variable-cell files are identified by a repeated POSCAR-like header and expose that header’s cell on the following frame. An incomplete final coordinate block is dropped and reported inissuesduring the full pass. The publicpathproperty returns the source filename.- Parameters:
filename (str | os.PathLike[str]) – Filesystem path to an XDATCAR, optionally compressed.
- property cell: tuple[tuple[str, str, str], Ellipsis][source]¶
Return the initial cell-vector lexemes.
- property symbols: tuple[str, Ellipsis] | None[source]¶
Return initial species symbols, or
Nonefor the older header form.
- property counts: tuple[int, Ellipsis][source]¶
Return the number of sites for each initial species entry.
- httk.io.vasp.xdatcar.read_xdatcar(source)[source]¶
Read an XDATCAR path into a lazy neutral
vasp-xdatcarpayload.- Parameters:
source (str | os.PathLike[str]) – Filesystem path to an XDATCAR, optionally compressed.
- Returns:
A neutral payload containing the lazy XDATCAR reader.
- Raises:
TypeError – If
sourceis not a filesystem path.FileNotFoundError – If the path does not exist.
- Return type: