KingsburyLab / pyEQL

A Python library for solution chemistry
Other
64 stars 17 forks source link

Solution.get_total_amount: bufix for mass based units #105

Closed rkingsbury closed 6 months ago

rkingsbury commented 6 months ago

Fixes a bug in which, due to a stray set of quotation marks, get_total_amount would fail with mass-based units:

   1200             TOT += amt * ion.get_el_amt_dict()[el]  # returns {el: mol per formula unit}
   1202         elif ureg.Quantity(units).dimensionality in (
   1203             "[mass]",
   1204             "[mass]/[length]**3",
   1205             "[mass]/[mass]",
   1206         ):
-> 1207             TOT += amt * ion.to_weight_dict["el"]  # returns {el: wt fraction}
   1209 return TOT

KeyError: 'el'
codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 80.31%. Comparing base (a62ea2c) to head (9209926). Report is 14 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #105 +/- ## ========================================== + Coverage 80.17% 80.31% +0.13% ========================================== Files 10 10 Lines 1448 1448 Branches 252 252 ========================================== + Hits 1161 1163 +2 + Misses 251 249 -2 Partials 36 36 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.