Skip to content

Commit

Permalink
Black tardis
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewfullard committed Jul 29, 2024
1 parent 56a9dbc commit 5e7a23b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
4 changes: 3 additions & 1 deletion tardis/plasma/tests/test_complete_plasmas.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ def plasma(
):
config["atom_data"] = str(chianti_he_db_fpath)
sim = Simulation.from_config(config)
data = self.regression_data.sync_hdf_store(sim.plasma, update_fname=False)
data = self.regression_data.sync_hdf_store(
sim.plasma, update_fname=False
)
yield sim.plasma
data.close()

Expand Down
14 changes: 9 additions & 5 deletions tardis/visualization/tools/sdec_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -791,9 +791,11 @@ def _calculate_plotting_data(
# Need to add a new value to the mask array for the 'other' column just added
mask = np.insert(mask, 0, True)
# Then drop all of the individual columns for species included in 'other'
self.absorption_luminosities_df = self.absorption_luminosities_df.drop(
self.absorption_luminosities_df.keys()[~mask],
axis=1,
self.absorption_luminosities_df = (
self.absorption_luminosities_df.drop(
self.absorption_luminosities_df.keys()[~mask],
axis=1,
)
)

# Get the list of species in the model
Expand Down Expand Up @@ -837,8 +839,10 @@ def _calculate_plotting_data(
].sum(axis=1),
)
# Then drop all of the individual columns for elements included in 'other'
self.absorption_luminosities_df = self.absorption_luminosities_df.drop(
sorted_list.keys()[nelements:], axis=1
self.absorption_luminosities_df = (
self.absorption_luminosities_df.drop(
sorted_list.keys()[nelements:], axis=1
)
)
# Get the list of species in the model
# Index from 1: to avoid the 'other' column
Expand Down
4 changes: 3 additions & 1 deletion tardis/visualization/widgets/custom_abundance.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,9 @@ def on_btn_add_shell(self, obj):
if end_index < len(v_vals) and np.isclose(v_vals[end_index], v_end):
# New shell will overwrite the original shell that ends at v_end.
v_vals = np.delete(v_vals, end_index)
self.data.abundance = self.data.abundance.drop(max(0, end_index - 1), 1)
self.data.abundance = self.data.abundance.drop(
max(0, end_index - 1), 1
)

# Insert new velocities calculate new densities according
# to new velocities through interpolation.
Expand Down

0 comments on commit 5e7a23b

Please sign in to comment.