Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solution: fix pH charge balancing bug and possible water ion imbalance #154

Merged
merged 3 commits into from
Jul 28, 2024

Conversation

rkingsbury
Copy link
Member

@rkingsbury rkingsbury commented Jul 28, 2024

[1.1.3] - 2024-07-28

Fixed

  • Solution: Fix a bug in which setting balance_charge to pH could result in
    negative concentration errors when charge balancing or after equilibrate was
    called. Solution now correctly enforces the ion product of water (Kw=1e-14)
    whenever adjusting the amounts of H+ or OH- for charge balancing.

Added

  • Solution._adjust_charge_balance: Added a privat helper method to consolidate charge
    balancing code used in __init__ and equilibrate.

@rkingsbury rkingsbury added release:patch will issue a patch release fix Bug Fixes labels Jul 28, 2024
Copy link

codecov bot commented Jul 28, 2024

Codecov Report

Attention: Patch coverage is 90.62500% with 3 lines in your changes missing coverage. Please review.

Project coverage is 82.93%. Comparing base (8bef6a4) to head (0e0ee6a).
Report is 1 commits behind head on main.

Files Patch % Lines
src/pyEQL/solution.py 90.32% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #154      +/-   ##
==========================================
+ Coverage   82.64%   82.93%   +0.29%     
==========================================
  Files           9        9              
  Lines        1469     1483      +14     
  Branches      322      320       -2     
==========================================
+ Hits         1214     1230      +16     
  Misses        216      216              
+ Partials       39       37       -2     

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

@rkingsbury rkingsbury merged commit 9291d27 into main Jul 28, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug Fixes release:patch will issue a patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant