From 86a4667646ed9832864057733ea4964318a152af Mon Sep 17 00:00:00 2001 From: Andrew Fullard Date: Mon, 12 Aug 2024 10:55:51 -0400 Subject: [PATCH] Fix accidental tuple --- tardis/io/atom_data/base.py | 52 +++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/tardis/io/atom_data/base.py b/tardis/io/atom_data/base.py index 4ec8728a6ee..29a109a775b 100644 --- a/tardis/io/atom_data/base.py +++ b/tardis/io/atom_data/base.py @@ -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"] ) @@ -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] + ), + ) ) ) @@ -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"