Skip to content

Commit

Permalink
Remove bandaid fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexHls committed Oct 12, 2023
1 parent fcb2f74 commit df33990
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions tardis/plasma/properties/transition_probabilities.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
from operator import le

import numpy as np
import pandas as pd
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit df33990

Please sign in to comment.