From f3a88bc3f95a25aee22e127c18b7b02101aac69c Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 8 Jul 2020 09:28:21 -0500 Subject: [PATCH] Address @eepeterson comments on #1602 --- openmc/model/surface_composite.py | 24 +++++++++++----------- tests/unit_tests/test_surface_composite.py | 12 ----------- 2 files changed, 12 insertions(+), 24 deletions(-) diff --git a/openmc/model/surface_composite.py b/openmc/model/surface_composite.py index 914ffc3389..8c4b99ae40 100644 --- a/openmc/model/surface_composite.py +++ b/openmc/model/surface_composite.py @@ -7,12 +7,6 @@ import openmc class CompositeSurface(ABC): """Multiple primitive surfaces combined into a composite surface""" - def evaluate(self, point): - raise NotImplementedError('Composite surfaces do not have a surface equation.') - - def _get_base_coeffs(self): - raise NotImplementedError('Composite surfaces do not have base coefficients.') - def translate(self, vector, inplace=False): surf = self if inplace else copy(self) for name in self._surface_names: @@ -264,7 +258,8 @@ class XConeOneSided(CompositeSurface): Parameter related to the aperature. Defaults to 1. up : bool Whether to select the side of the cone that extends to infinity in the - positive direction of the coordinate axis + positive direction of the coordinate axis (the positive half-space of + the ambiguity plane) **kwargs Keyword arguments passed to underlying plane classes @@ -276,7 +271,8 @@ class XConeOneSided(CompositeSurface): Ambiguity surface up : bool Whether to select the side of the cone that extends to infinity in the - positive direction of the coordinate axis + positive direction of the coordinate axis (the positive half-space of + the ambiguity plane) """ _surface_names = ('cone', 'plane') @@ -319,7 +315,8 @@ class YConeOneSided(CompositeSurface): Parameter related to the aperature. Defaults to 1. up : bool Whether to select the side of the cone that extends to infinity in the - positive direction of the coordinate axis + positive direction of the coordinate axis (the positive half-space of + the ambiguity plane) **kwargs Keyword arguments passed to underlying plane classes @@ -331,7 +328,8 @@ class YConeOneSided(CompositeSurface): Ambiguity surface up : bool Whether to select the side of the cone that extends to infinity in the - positive direction of the coordinate axis + positive direction of the coordinate axis (the positive half-space of + the ambiguity plane) """ _surface_names = ('cone', 'plane') @@ -368,7 +366,8 @@ class ZConeOneSided(CompositeSurface): Parameter related to the aperature. Defaults to 1. up : bool Whether to select the side of the cone that extends to infinity in the - positive direction of the coordinate axis + positive direction of the coordinate axis (the positive half-space of + the ambiguity plane) **kwargs Keyword arguments passed to underlying plane classes @@ -380,7 +379,8 @@ class ZConeOneSided(CompositeSurface): Ambiguity surface up : bool Whether to select the side of the cone that extends to infinity in the - positive direction of the coordinate axis + positive direction of the coordinate axis (the positive half-space of + the ambiguity plane) """ _surface_names = ('cone', 'plane') diff --git a/tests/unit_tests/test_surface_composite.py b/tests/unit_tests/test_surface_composite.py index f7eec7a6d2..28ded03cba 100644 --- a/tests/unit_tests/test_surface_composite.py +++ b/tests/unit_tests/test_surface_composite.py @@ -99,10 +99,6 @@ def test_rectangular_parallelepiped(): assert (xmin + dx/2, ymin + dy/2, zmin + dz/2) in -s assert (xmin + dx/2, ymin + dy/2, zmin + dz/2) not in +s - # evaluate method - with pytest.raises(NotImplementedError): - s.evaluate((0., 0., 0.)) - # translate method t = uniform(-5.0, 5.0) s_t = s.translate((t, t, t)) @@ -152,10 +148,6 @@ def test_right_circular_cylinder(axis, indices): assert point_neg in -s assert point_neg not in +s - # evaluate method - with pytest.raises(NotImplementedError): - s.evaluate((0., 0., 0.)) - # translate method t = uniform(-5.0, 5.0) s_t = s.translate((t, t, t)) @@ -206,10 +198,6 @@ def test_cone_one_sided(axis, point_pos, point_neg, ll_true): assert point_neg in -s assert point_neg not in +s - # evaluate method - with pytest.raises(NotImplementedError): - s.evaluate((0., 0., 0.)) - # translate method t = uniform(-5.0, 5.0) s_t = s.translate((t, t, t))