From d76434379af9a56cfe60ad4b49b29982af1e9d6b Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 29 Apr 2022 19:25:01 -0500 Subject: [PATCH] Make sure basis gets set in Plot.from_geometry --- openmc/plots.py | 1 + tests/unit_tests/test_plots.py | 1 + 2 files changed, 2 insertions(+) diff --git a/openmc/plots.py b/openmc/plots.py index 6bce8894c8..5e9c48413d 100644 --- a/openmc/plots.py +++ b/openmc/plots.py @@ -512,6 +512,7 @@ class Plot(IDManagerMixin): plot.origin = np.insert((lower_left + upper_right)/2, slice_index, slice_coord) plot.width = upper_right - lower_left + plot.basis = basis return plot def colorize(self, geometry, seed=1): diff --git a/tests/unit_tests/test_plots.py b/tests/unit_tests/test_plots.py index 3288617b08..718f098ba9 100644 --- a/tests/unit_tests/test_plots.py +++ b/tests/unit_tests/test_plots.py @@ -58,6 +58,7 @@ def test_from_geometry(): plot = openmc.Plot.from_geometry(geom, basis) assert plot.origin == pytest.approx((0., 0., 0.)) assert plot.width == pytest.approx((width, width)) + assert plot.basis == basis def test_highlight_domains():