Skip to content

feat(parser): record fermi level on the DOS output node - #62

Merged
zhubonan merged 1 commit into
MCresearch:developfrom
stillfast:feat/dos-fermi-level
Aug 19, 2026
Merged

zhubonan merged 1 commit into
MCresearch:developfrom
stillfast:feat/dos-fermi-level

Conversation

@stillfast

Copy link
Copy Markdown
Contributor

The bands branch already attaches fermi_level (parsed from the EFERMI = <value> <unit> line in running_*.log) to the BandsData node as a base attribute. The DOS branch was missing this, so callers that plot the DOS could not align it with the fermi level from the sibling bands output.

Mirror the bands convention in the DOS branch: read the fermi level already stored in misc_results["fermi_level"] and, when present, attach it to the dos ArrayData as base.attributes["fermi_level"]. When the running log does not contain an EFERMI line the DOS node is produced unchanged.

Tests: one new integration case in tests/test_parser.py, test_parser_dos_records_fermi_level_from_running_log, which stages the pw_Si2 fixture (reporting EFERMI = 6.5508038645 eV) plus a synthetic DOS1 file and asserts the DOS node carries the same value. The omission path is covered by the if fermi_level is not None guard itself.

The bands branch already attaches `fermi_level` (parsed from the
`EFERMI = <value> <unit>` line in `running_*.log`) to the BandsData
node as a base attribute. The DOS branch was missing this, so callers
that plot the DOS could not align it with the fermi level from the
sibling bands output.

Mirror the bands convention in the DOS branch: read the fermi level
already stored in `misc_results["fermi_level"]` and, when present,
attach it to the dos ArrayData as `base.attributes["fermi_level"]`.
When the running log does not contain an `EFERMI` line the DOS node
is produced unchanged.

Tests: one new integration case in `tests/test_parser.py`,
`test_parser_dos_records_fermi_level_from_running_log`, which stages
the pw_Si2 fixture (reporting `EFERMI = 6.5508038645 eV`) plus a
synthetic DOS1 file and asserts the DOS node carries the same value.
The omission path is covered by the `if fermi_level is not None`
guard itself.
@zhubonan
zhubonan merged commit 48eef75 into MCresearch:develop Aug 19, 2026
3 checks passed
@stillfast
stillfast deleted the feat/dos-fermi-level branch August 20, 2026 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants