Update bounding_box docstrings (#2972)

This commit is contained in:
Paul Romano 2024-04-24 08:02:05 -05:00 committed by GitHub
parent cddb3be139
commit b54b1e975c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 5 deletions

View file

@ -343,8 +343,7 @@ class Cell(IDManagerMixin):
if self.region is not None:
return self.region.bounding_box
else:
return BoundingBox(np.array([-np.inf, -np.inf, -np.inf]),
np.array([np.inf, np.inf, np.inf]))
return BoundingBox.infinite()
@property
def num_instances(self):

View file

@ -18,6 +18,11 @@ class Region(ABC):
respective classes are typically not instantiated directly but rather are
created through operators of the Surface and Region classes.
Attributes
----------
bounding_box : openmc.BoundingBox
Axis-aligned bounding box of the region
"""
def __and__(self, other):
return Intersection((self, other))
@ -415,7 +420,7 @@ class Intersection(Region, MutableSequence):
Attributes
----------
bounding_box : openmc.BoundingBox
Lower-left and upper-right coordinates of an axis-aligned bounding box
Axis-aligned bounding box of the region
"""
@ -503,7 +508,7 @@ class Union(Region, MutableSequence):
Attributes
----------
bounding_box : openmc.BoundingBox
Lower-left and upper-right coordinates of an axis-aligned bounding box
Axis-aligned bounding box of the region
"""
@ -594,7 +599,7 @@ class Complement(Region):
node : openmc.Region
Regions to take the complement of
bounding_box : openmc.BoundingBox
Lower-left and upper-right coordinates of an axis-aligned bounding box
Axis-aligned bounding box of the region
"""