Skip to content

Parsing

Functions

parse_dos(path: Path | str) -> DOSResult

Parse an AkaiKKR DOS output file.

Parameters:

Name Type Description Default

path

Path | str

Path to the DOS output file.

required

Returns:

Type Description
DOSResult

The parsed DOS result.

parse_go(path: Path | str) -> GOResult

Parse an AkaiKKR GO output file.

Parameters:

Name Type Description Default

path

Path | str

Path to the GO output file.

required

Returns:

Type Description
GOResult

The parsed GO result.

parse_spc(path: Path | str, *, base_dir: Path | str | None = None, data_up: Path | str | None = None, data_down: Path | str | None = None) -> SPCResult

Parse an AkaiKKR SPC output file.

Spectral function data files (*_up.spc, *_dn.spc) are located automatically by appending _up.spc / _dn.spc to input_params.file and resolving from base_dir. Supply data_up or data_down to override either path explicitly.

Parameters:

Name Type Description Default

path

Path | str

Path to the SPC log file.

required

base_dir

Path | str | None

Directory from which input_params.file is resolved to auto-locate the spectral function data files. Defaults to the log file's parent directory.

None

data_up

Path | str | None

Explicit path to the spin-up spectral function data file.

None

data_down

Path | str | None

Explicit path to the spin-down spectral function data file.

None

Returns:

Type Description
SPCResult

The parsed SPC result.


Parser classes

These are used internally by parse_dos(), parse_go(), and parse_spc(). You can instantiate them directly if you need finer control over the parsing process.

DOSParser

Parse AkaiKKR DOS and DSP output files.

parse(path: Path | str) -> DOSResult

Parse an AkaiKKR DOS or DSP output file.

Parameters:

Name Type Description Default

path

Path | str

Path to the DOS or DSP output file.

required

Returns:

Type Description
DOSResult

The parsed DOS result.

GOParser

Parse AkaiKKR GO output files.

parse(path: Path | str) -> GOResult

Parse an AkaiKKR GO output file.

Parameters:

Name Type Description Default

path

Path | str

Path to the GO output file.

required

Returns:

Type Description
GOResult

The parsed GO result.

SPCParser

Parse AkaiKKR SPC output files.

parse(path: Path | str, *, base_dir: Path | str | None = None, data_up: Path | str | None = None, data_down: Path | str | None = None) -> SPCResult

Parse an AkaiKKR SPC log file and optional spectral function data.

Spectral function data files (*_up.spc, *_dn.spc) are located automatically by appending _up.spc / _dn.spc to input_params.file and resolving from base_dir. Supply data_up or data_down to override either path explicitly.

Parameters:

Name Type Description Default

path

Path | str

Path to the SPC log file.

required

base_dir

Path | str | None

Directory from which input_params.file is resolved to auto-locate the spectral function data files. Defaults to the log file's parent directory.

None

data_up

Path | str | None

Explicit path to the spin-up spectral function data file; overrides auto-discovery.

None

data_down

Path | str | None

Explicit path to the spin-down spectral function data file; overrides auto-discovery.

None

Returns:

Type Description
SPCResult

The parsed SPC result. spectral_up / spectral_down are

SPCResult

None when their data files cannot be found.

Raises:

Type Description
ParseError

If the log file is missing required sections.