Skip to content

Commit

Permalink
Fix accidental tuple
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewfullard committed Aug 15, 2024
1 parent dca8511 commit 86a4667
Showing 1 changed file with 27 additions and 25 deletions.
52 changes: 27 additions & 25 deletions tardis/io/atom_data/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,9 +494,9 @@ def prepare_continuum_interaction_data(self, continuum_interaction_species):
)

level_idxs2continuum_idx = photo_ion_levels_idx.copy()
level_idxs2continuum_idx[
"continuum_idx"
] = self.level2continuum_edge_idx
level_idxs2continuum_idx["continuum_idx"] = (
self.level2continuum_edge_idx
)
self.level_idxs2continuum_idx = level_idxs2continuum_idx.set_index(
["source_level_idx", "destination_level_idx"]
)
Expand Down Expand Up @@ -530,31 +530,33 @@ def prepare_macro_atom_data(
self.macro_atom_references = self.macro_atom_references.loc[
self.macro_atom_references["count_down"] > 0
]
self.macro_atom_references.loc[
:, "count_total"
] = self.macro_atom_references["count_down"]
self.macro_atom_references.loc[
:, "block_references"
] = np.hstack(
(
0,
np.cumsum(
self.macro_atom_references["count_down"].values[:-1]
),
self.macro_atom_references.loc[:, "count_total"] = (
self.macro_atom_references["count_down"]
)
self.macro_atom_references.loc[:, "block_references"] = (
np.hstack(
(
0,
np.cumsum(
self.macro_atom_references["count_down"].values[
:-1
]
),
)
)
)

elif line_interaction_type == "macroatom":
self.macro_atom_references.loc[
:, "block_references"
] = np.hstack(
(
0,
np.cumsum(
self.macro_atom_references["count_total"].values[
:-1
]
),
self.macro_atom_references.loc[:, "block_references"] = (
np.hstack(
(
0,
np.cumsum(
self.macro_atom_references[
"count_total"
].values[:-1]
),
)
)
)

Expand Down Expand Up @@ -664,7 +666,7 @@ def get_attributes_from_store(store, store_key):
try:
attribute = store.root._v_attrs[store_key]
if hasattr(attribute, "decode"):
attribute = (attribute.decode("ascii"),)
attribute = attribute.decode("ascii")
except KeyError:
logger.debug(
f"{store_key} not available for Atom Data. Setting value to None"
Expand Down

0 comments on commit 86a4667

Please sign in to comment.