-
Notifications
You must be signed in to change notification settings - Fork 500
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added inf check in VolumeCalculation. (#2634)
Co-authored-by: Rosie Barker <[email protected]> Co-authored-by: Paul Romano <[email protected]>
- Loading branch information
1 parent
471caa5
commit b62b62a
Showing
2 changed files
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import numpy as np | ||
import pytest | ||
|
||
import openmc | ||
|
||
|
||
def test_infinity_handling(): | ||
surf1 = openmc.Sphere(boundary_type="vacuum") | ||
cell1 = openmc.Cell(region=-surf1) | ||
|
||
lower_left = (-2, -np.inf, -2) | ||
upper_right = (np.inf, 2, 2) | ||
|
||
with pytest.raises(ValueError, match="must be finite"): | ||
openmc.VolumeCalculation([cell1], 100, lower_left, upper_right) |