Skip to content

Commit

Permalink
Fixes CMFGEN tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewfullard committed Sep 10, 2024
1 parent 9127f1f commit 8d53b89
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions carsus/io/cmfgen/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,9 +659,11 @@ def cross_sections_squeeze(
lower_level_label = target.attrs["Configuration name"]
cross_section_type = target.attrs["Type of cross-section"]

# Remove the "[J]" term from J-splitted levels labels
ion_levels["label"] = ion_levels["label"].str.rstrip("]")
ion_levels["label"] = ion_levels["label"].str.split("[", expand=True)
if ion_levels["label"].str.contains(r"\[").any():
# Remove the "[J]" term from J-splitted levels labels
ion_levels["label"] = ion_levels["label"].str.rstrip("]")
# Drop the [J] term completely to avoid shape mismatch. Something to perhaps store in the future
ion_levels["label"] = ion_levels["label"].str.split("[", expand=True)[0]

try:
match = ion_levels.set_index("label").loc[[lower_level_label]]
Expand Down

0 comments on commit 8d53b89

Please sign in to comment.