You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(outputs.py): handle missing trailing newline in ICOHPLIST.lobster (#4350)
* fix(outputs.py): handle missing trailing newline in ICOHPLIST.lobster
LOBSTER 5.1.1 sometimes produces an ICOHPLIST.lobster file without a trailing
newline, which causes the Icohplist parser to miscount bond entries (e.g., 1079 vs. 1080).
This commit updates the file-reading logic in Icohplist.__init__ to use splitlines()
and filters out any blank lines, ensuring that only valid, non-empty lines are parsed.
This change prevents the ValueError ("COHPCAR and ICOHPLIST do not fit together")
and aligns the bond count with COHPCAR.lobster.
Ref: See related issue in lobsterpy (#389) for additional context.
Signed-off-by: Ali Hussain Umar Bhatti <[email protected]>
* pre-commit auto-fixes
* Update outputs.py
* Add test_missing_trailing_newline
* Robust header detection and version parsing in Icohplist
- Strip only trailing blank lines so a missing final newline still works
- Compute header length dynamically (skip title and optional spin‐line)
- Determine LOBSTER version by column count (6→2.2.1, 8→3.1.1, 9→5.1.0)
- Preserve non‐orbitalwise LCFO entries (fixes length mismatch for non-orbitalwise LCFO lists)
---------
Signed-off-by: Ali Hussain Umar Bhatti <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Shyue Ping Ong <[email protected]>
0 commit comments