Skip to content

Commit 7552ace

Browse files
shimwellgithub-actions[bot]
authored andcommitted
[skip ci] Apply formatting changes
1 parent c7a0d70 commit 7552ace

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

src/openmc_source_plotter/core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def plot_source_energy(
9898
xaxis_units: The units to use for the x axis. Options are 'eV' or 'MeV'.
9999
"""
100100

101-
if xaxis_units not in ['eV', 'MeV']:
101+
if xaxis_units not in ["eV", "MeV"]:
102102
raise ValueError(f"xaxis_units must be either 'eV' or 'MeV' not {xaxis_units}")
103103

104104
if figure is None:
@@ -121,8 +121,8 @@ def plot_source_energy(
121121
if isinstance(self, openmc.SourceBase):
122122
probability = probability * self.strength
123123
energy = bin_edges[:-1]
124-
if xaxis_units == 'MeV':
125-
energy = energy /1e6
124+
if xaxis_units == "MeV":
125+
energy = energy / 1e6
126126
# Plot source energy histogram
127127
figure.add_trace(
128128
plotly.graph_objects.Scatter(

tests/test_core_with_source.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,14 @@ def test_energy_plot(test_source):
4747
assert isinstance(plot, go.Figure)
4848
assert len(plot.data[0]["x"]) == 1
4949

50+
5051
def test_energy_plot_axis(test_source):
51-
plot = test_source.plot_source_energy(n_samples=10, xaxis_type='log', yaxis_type='linear', xaxis_units='eV')
52-
plot = test_source.plot_source_energy(n_samples=10, xaxis_type='linear', yaxis_type='log', xaxis_units='MeV')
52+
plot = test_source.plot_source_energy(
53+
n_samples=10, xaxis_type="log", yaxis_type="linear", xaxis_units="eV"
54+
)
55+
plot = test_source.plot_source_energy(
56+
n_samples=10, xaxis_type="linear", yaxis_type="log", xaxis_units="MeV"
57+
)
5358
assert isinstance(plot, go.Figure)
5459
assert len(plot.data[0]["x"]) == 1
5560

0 commit comments

Comments
 (0)