Skip to content

equilibrate: exclude H and O from missing element check#355

Merged
rkingsbury merged 3 commits intomainfrom
bugfix
Feb 16, 2026
Merged

equilibrate: exclude H and O from missing element check#355
rkingsbury merged 3 commits intomainfrom
bugfix

Conversation

@rkingsbury
Copy link
Member

@rkingsbury rkingsbury commented Feb 16, 2026

Summary

This PR exempts elements H and O from the "missing element" check that is performed in equilibrate, because PHREEQC may not necessarily include H2O(aq) in its list of solutes, and thus could generate a false positive error when comparing the original and new total amounts of H and O.

WIP - I am still trying to understand the source of this behavior. The numbers in the error message highlighted in #329 suggest that it's just a matter of H2O not being counted, but that doesn't seem to be the case from the tests I'm running so far.

UPDATE: I found a cleaner solution. The cause was in fact that phreeqc2026 doesn't include H2O(aq) in its returned list of components; however pyEQL was already adding this back in as part of the volume rescaling logic; it was just doing so after the missing elements check. It actually makes sense to do it before the missing elements check anyway, and moving the volume rescaling up also prevents the false positive errors on H and O elements.

@rkingsbury rkingsbury marked this pull request as draft February 16, 2026 18:58
@codecov
Copy link

codecov bot commented Feb 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.10%. Comparing base (32c3aaa) to head (ad35082).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #355      +/-   ##
==========================================
- Coverage   86.27%   86.10%   -0.17%     
==========================================
  Files          14       14              
  Lines        1821     1821              
  Branches      313      313              
==========================================
- Hits         1571     1568       -3     
- Misses        207      209       +2     
- Partials       43       44       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rkingsbury rkingsbury marked this pull request as ready for review February 16, 2026 22:00
@rkingsbury rkingsbury added the fix Bug Fixes label Feb 16, 2026
@rkingsbury rkingsbury merged commit ea24ec3 into main Feb 16, 2026
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant