fix(graspa): parse output by section instead of fixed line indices - #23
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.