diff --git a/openmc/model/surface_composite.py b/openmc/model/surface_composite.py index e1696edceb..e3ac7e345c 100644 --- a/openmc/model/surface_composite.py +++ b/openmc/model/surface_composite.py @@ -6,6 +6,7 @@ import numpy as np import openmc from openmc.checkvalue import check_greater_than, check_value + class CompositeSurface(ABC): """Multiple primitive surfaces combined into a composite surface""" @@ -92,7 +93,7 @@ class CylinderSector(CompositeSurface): """ - _surface_names = ('outer_cyl','inner_cyl', + _surface_names = ('outer_cyl', 'inner_cyl', 'plane0', 'plane1') def __init__(self, center, r1, r2, theta0, theta, axis='z', **kwargs): @@ -132,7 +133,7 @@ class CylinderSector(CompositeSurface): **kwargs) def __neg__(self): - return -self.outer_cyl & +self.inner_cyl & -self.plane0 & +self.plane1 + return -self.outer_cyl & +self.inner_cyl & -self.plane0 & +self.plane1 def __pos__(self): return +self.outer_cyl | -self.inner_cyl | +self.plane0 | -self.plane1 @@ -206,10 +207,10 @@ class IsogonalOctagon(CompositeSurface): # Side lengths if r2 > r1 * sqrt(2): - raise ValueError(f'r2 is greater than sqrt(2) * r1. Octagon' + \ + raise ValueError(f'r2 is greater than sqrt(2) * r1. Octagon' + ' may be erroneous.') if r1 > r2 * sqrt(2): - raise ValueError(f'r1 is greater than sqrt(2) * r2. Octagon' + \ + raise ValueError(f'r1 is greater than sqrt(2) * r2. Octagon' + ' may be erroneous.') L_basis_ax = (r2 * sqrt(2) - r1) diff --git a/tests/unit_tests/test_surface_composite.py b/tests/unit_tests/test_surface_composite.py index 6b9b6c7a53..7985a2aaec 100644 --- a/tests/unit_tests/test_surface_composite.py +++ b/tests/unit_tests/test_surface_composite.py @@ -12,7 +12,8 @@ def test_rectangular_parallelepiped(): ymax = ymin + uniform(0., 5.) zmin = uniform(-5., 5.) zmax = zmin + uniform(0., 5.) - s = openmc.model.RectangularParallelepiped(xmin, xmax, ymin, ymax, zmin, zmax) + s = openmc.model.RectangularParallelepiped( + xmin, xmax, ymin, ymax, zmin, zmax) assert isinstance(s.xmin, openmc.XPlane) assert isinstance(s.xmax, openmc.XPlane) assert isinstance(s.ymin, openmc.YPlane) @@ -286,5 +287,3 @@ def test_isogonal_octagon(axis, plane_tb, plane_lr, axis_idx): # Make sure repr works repr(s) - -