Skip to content

fix(graspa): parse output by section instead of fixed line indices - #23

Merged
tdpham2 merged 1 commit into
mainfrom
fix/graspa-output-parsing
Sep 17, 2026
Merged

tdpham2 merged 1 commit into
mainfrom
fix/graspa-output-parsing

Conversation

@tdpham2

@tdpham2 tdpham2 commented Sep 17, 2026

Copy link
Copy Markdown
Owner

get_output_data indexed the flat list of "Overall: Average" lines by hardcoded positions (eos True/False). That assumed a fixed layout, but gRASPA prints an extra framework COMPONENT [0] loading block in the # MOLECULES / mg/g / mol/kg sections (not in HEAT or g/L), plus an EXCESS sub-block per loading section. The offsets therefore drifted: mg/g silently returned the framework artifact (1000.0 mg/g) instead of the adsorbate loading, while mol/kg and g/L matched only by coincidence.

Parse section-aware instead: key on the section header and the first non-framework COMPONENT, take its absolute (non-EXCESS) Overall line. This is robust to the number of components/blocks and to EXCESS blocks (including the overflowing excess g/L values). The eos argument is kept for backward compatibility but is now ignored.

Verified against hand-checked raspa.log values across multiple frameworks, guests, and both classical campaign trees.

get_output_data indexed the flat list of "Overall: Average" lines by
hardcoded positions (eos True/False). That assumed a fixed layout, but
gRASPA prints an extra framework COMPONENT [0] loading block in the
# MOLECULES / mg/g / mol/kg sections (not in HEAT or g/L), plus an
EXCESS sub-block per loading section. The offsets therefore drifted:
mg/g silently returned the framework artifact (1000.0 mg/g) instead of
the adsorbate loading, while mol/kg and g/L matched only by coincidence.

Parse section-aware instead: key on the section header and the first
non-framework COMPONENT, take its absolute (non-EXCESS) Overall line.
This is robust to the number of components/blocks and to EXCESS blocks
(including the overflowing excess g/L values). The eos argument is kept
for backward compatibility but is now ignored.

Verified against hand-checked raspa.log values across multiple
frameworks, guests, and both classical campaign trees.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@tdpham2
tdpham2 merged commit 8e6ce51 into main Sep 17, 2026
2 of 6 checks passed
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.

1 participant