mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Adding energy axis units to plot xs (#2876)
Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
parent
02c0a09281
commit
b75ccd598e
2 changed files with 25 additions and 4 deletions
|
|
@ -77,10 +77,19 @@ def test_plot_xs(this):
|
|||
from matplotlib.figure import Figure
|
||||
assert isinstance(openmc.plot_xs({this: ['total', 'elastic']}), Figure)
|
||||
|
||||
|
||||
def test_plot_xs_mat(test_mat):
|
||||
from matplotlib.figure import Figure
|
||||
assert isinstance(openmc.plot_xs({test_mat: ['total']}), Figure)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("units", ["eV", "keV", "MeV"])
|
||||
def test_plot_xs_energy_axis(units):
|
||||
plot = openmc.plot_xs({'Be9': ['(n,2n)']}, energy_axis_units=units)
|
||||
axis_text = plot.get_axes()[0].get_xaxis().get_label().get_text()
|
||||
assert axis_text == f'Energy [{units}]'
|
||||
|
||||
|
||||
def test_plot_axes_labels():
|
||||
# just nuclides
|
||||
axis_label = openmc.plotter._get_yaxis_label(
|
||||
|
|
@ -156,4 +165,4 @@ def test_get_title():
|
|||
mat1.set_density('g/cm3', 1)
|
||||
mat1.name = 'my_mat'
|
||||
title = openmc.plotter._get_title(reactions={mat1: [205]})
|
||||
assert title == 'Cross Section Plot For my_mat'
|
||||
assert title == 'Cross Section Plot For my_mat'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue