Handle Omitted Hypthetical Solid Solutions in EQ3 Output - #194
Merged
Conversation
The `consume_to_header` method leaves the parser state exactly where it needs to be for the subsequent `read_product_phases`, so there's no reason to rewind.
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.
Summary
OutputParser3failed to parse EQ3 (.3o) output files that omit the hypothetical solidsolutions and fugacities sections.
read_product_phasesraised aPARSER_ERRORwhen the"Saturation States of Hypothetical Solid Solutions" header was not found before EOF, even though
both sections are optional.
These two sections are optional but always appear together, with the hypothetical solid solutions
preceding the fugacities.
parse()now probes for the leading header and only reads both sectionswhen it is present, skipping both when it is absent. The change is scoped to
OutputParser3; theshared base-class helpers (
read_product_phases,read_fugacities) are untouched.Closes #187.
Type of Change
Testing
Added
test_can_parse_3o_without_hypothetical_solid_solutions, backed by a newno-hypothetical-solid-solutions.3ofixture that omits both sections. The full parser suite passes,including the existing fixtures that do contain the sections.
pytest)Checklist
pre-commit run --all-files)[Unreleased](for user-facing changes)