diff --git a/tardis/io/model_reader.py b/tardis/io/model_reader.py index 18225ff0d8f..ec76fd3712b 100644 --- a/tardis/io/model_reader.py +++ b/tardis/io/model_reader.py @@ -167,15 +167,21 @@ def read_uniform_abundances(abundances_section, no_of_shells): try: if element_symbol_string in nucname.name_zz: z = nucname.name_zz[element_symbol_string] - abundance.loc[z] = float( - abundances_section[element_symbol_string] - ) + if abundances_section[element_symbol_string] > 0: + abundance.loc[z] = float( + abundances_section[element_symbol_string] + ) + else: + raise ValueError(f"Abundance Must Be A Positive Value") else: mass_no = nucname.anum(element_symbol_string) z = nucname.znum(element_symbol_string) - isotope_abundance.loc[(z, mass_no), :] = float( - abundances_section[element_symbol_string] - ) + if abundances_section[element_symbol_string] > 0: + isotope_abundance.loc[(z, mass_no), :] = float( + abundances_section[element_symbol_string] + ) + else: + raise ValueError(f"Abundance Must Be A Positive Value") except RuntimeError as err: raise RuntimeError(