diff --git a/tardis/io/atom_data/base.py b/tardis/io/atom_data/base.py index c9a4883a9ba..76fc424a3c4 100644 --- a/tardis/io/atom_data/base.py +++ b/tardis/io/atom_data/base.py @@ -546,9 +546,9 @@ def prepare_continuum_interaction_data(self, continuum_interaction_species): ) level_idxs2continuum_idx = self.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"] ) @@ -582,33 +582,31 @@ 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 + ] + ), ) ) @@ -726,12 +724,12 @@ def _init_indices(self): & (self.lines.ion_number == species[1]) ) self.lines_idx[species] = lines_idx - self.lines_level_number_lower[species] = ( - self.lines.level_number_lower.values[lines_idx].astype(int) - ) - self.lines_level_number_upper[species] = ( - self.lines.level_number_upper.values[lines_idx].astype(int) - ) + self.lines_level_number_lower[ + species + ] = self.lines.level_number_lower.values[lines_idx].astype(int) + self.lines_level_number_upper[ + species + ] = self.lines.level_number_upper.values[lines_idx].astype(int) self.A_uls[species] = self.atom_data.lines.A_ul.values[lines_idx] self.B_uls[species] = self.atom_data.lines.B_ul.values[lines_idx] @@ -766,9 +764,9 @@ def _create_collision_coefficient_matrix(self): line, ) in collision_group.get_group(species).iterrows(): # line.columns : delta_e, g_ratio, temperatures ... - C_ul_matrix[level_number_lower, level_number_upper, :] = ( - line.values[2:] - ) + C_ul_matrix[ + level_number_lower, level_number_upper, : + ] = line.values[2:] delta_E_matrix[level_number_lower, level_number_upper] = line[ "delta_e" ]