diff --git a/tardis/plasma/properties/transition_probabilities.py b/tardis/plasma/properties/transition_probabilities.py index 7b823633aee..d11cf1fa90d 100644 --- a/tardis/plasma/properties/transition_probabilities.py +++ b/tardis/plasma/properties/transition_probabilities.py @@ -1,4 +1,5 @@ import logging +from operator import le import numpy as np import pandas as pd @@ -330,22 +331,11 @@ def calculate( names=p_deactivation.index.names, ) fb_cooling_probs.insert(0, "lines_idx", continuum_idx) - # Since 'at' seems to be faster than 'loc' we try it first - # However, if the index is not unique, 'at' will raise a ValueError - try: - fb_cooling_probs.insert( - 0, - "transition_type", - level_idxs2transition_idx.at[("k", "bf"), "transition_type"], - ) - except ValueError: - fb_cooling_probs.insert( - 0, - "transition_type", - level_idxs2transition_idx.loc[ - ("k", "bf"), "transition_type" - ].values[0], - ) + fb_cooling_probs.insert( + 0, + "transition_type", + level_idxs2transition_idx.at[("k", "bf"), "transition_type"], + ) # Check if there are two-photon decays if "two-photon" in p_deactivation.index.get_level_values(1):