Merge pull request #2050 from paulromano/plot-basis-fix

Make sure basis gets set in Plot.from_geometry
This commit is contained in:
Patrick Shriwise 2022-05-01 23:39:15 -05:00 committed by GitHub
commit 6a8a870dd1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View file

@ -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):

View file

@ -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():