Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update bounding_box docstrings #2972

Merged
merged 1 commit into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions openmc/cell.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,7 @@ def bounding_box(self):
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):
Expand Down
11 changes: 8 additions & 3 deletions openmc/region.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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

"""

Expand Down Expand Up @@ -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

"""

Expand Down Expand Up @@ -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

"""

Expand Down