Print messages#6
Open
TimBartholomew wants to merge 4 commits into
Open
Conversation
Owner
|
This looks good. @TimBartholomew Please updated with latest main change and re-run tests. Not sure why its not letting me auto push latest changes into this pr... |
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
This PR removes repeated console spam during batch PHREEQC runs and fixes the underlying Alkalinity MW handling that was triggering it.
The repeated messages came from two places:
phreeqcWTapiinstantiationAlkalinity, even when the metadata already had a valid stored MW for the intentional formulaCa0.5(CO3)0.5That second path could fail to parse the formula and fall back noisily, which is why repeated PW_TEA runs produced the typo-heavy warning many times.
What changed
Loading database file: ...console print with debug logging, so default behavior is quiet.check_formula_consistent()reuses the existing stored MW when:Ca0.5(CO3)0.5with MW50.05during metadata-derived MW calculation.Alkalinityinput support.Behavior impact
This is not only output suppression.
It also fixes the underlying Alkalinity MW/formula path so normal direct
Alkalinityusage no longer attempts an unnecessary recomputation and no longer falls into the noisy fallback path.Public behavior is otherwise intended to remain stable:
Tests
Added regression coverage for:
Alkalinityinput still generating only the alkalinity lineAlkalinityinput reusing metadata MW without console outputphreeqcWTapi(database="phreeqc.dat")instantiation staying quiet by defaultCaHCO3helper behavior still generating both carbon and alkalinity linesValidated locally with:
pytest src/phreeqcinwt/tests/test_solution_build.py -k "direct_alkalinity or repeated_instantiation or cahco3"Alkalinityinput and no console outputpython -m black --check src/phreeqcinwt/core/data_base_utils.py src/phreeqcinwt/core/utility_functions.py src/phreeqcinwt/tests/test_solution_build.py