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.get_total_amount: bufix for mass based units #105

Merged
merged 1 commit into from
Feb 25, 2024
Merged

Conversation

rkingsbury
Copy link
Member

@rkingsbury rkingsbury commented Feb 25, 2024

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'

Copy link

codecov bot commented Feb 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

Additional details and impacted files
@@            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              

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

@rkingsbury rkingsbury added the fix Bug Fixes label Feb 25, 2024
@rkingsbury rkingsbury merged commit 6fea057 into main Feb 25, 2024
16 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