Skip to content

Commit

Permalink
Add positive nmf assert
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexHls authored Nov 21, 2023
1 parent f65a2d7 commit 8562e0a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tardis/model/parse_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,11 @@ def convert_to_nuclide_mass_fraction(isotope_mass_fraction, mass_fraction):
nuclide_mass_fraction = pd.concat(
[nuclide_mass_fraction, isotope_mass_fraction]
)
assert (
nuclide_mass_fraction < 0.0
).sum().sum() == 0, (
"Nuclide mass fraction must be positive. Negative values found."
)
return nuclide_mass_fraction


Expand Down

0 comments on commit 8562e0a

Please sign in to comment.