mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Converting double max to np.inf on the Python side for bounding boxes.
This commit is contained in:
parent
5ad4f94f3a
commit
d5eaa3b5b7
4 changed files with 27 additions and 13 deletions
|
|
@ -1,6 +1,5 @@
|
|||
from collections.abc import Mapping
|
||||
import os
|
||||
import sys
|
||||
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
|
@ -477,10 +476,8 @@ def test_position(capi_init):
|
|||
|
||||
|
||||
def test_global_bounding_box(capi_init):
|
||||
inf = sys.float_info.max
|
||||
|
||||
expected_llc = (-0.63, -0.63, -inf)
|
||||
expected_urc = (0.63, 0.63, inf)
|
||||
expected_llc = (-0.63, -0.63, -np.inf)
|
||||
expected_urc = (0.63, 0.63, np.inf)
|
||||
|
||||
llc, urc = openmc.capi.global_bounding_box()
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
import sys
|
||||
|
||||
import numpy as np
|
||||
import openmc.capi
|
||||
import pytest
|
||||
|
|
@ -82,13 +80,17 @@ def complex_cell(run_in_tmpdir):
|
|||
|
||||
openmc.capi.finalize()
|
||||
|
||||
inf = sys.float_info.max
|
||||
|
||||
expected_results = ( (1, (( -4., -4., -inf), ( 4., 4., inf))),
|
||||
(2, (( -7., -7., -inf), ( 7., 7., inf))),
|
||||
(3, ((-10., -10., -inf), (10., 10., inf))),
|
||||
(4, ((-10., -10., -inf), (10., 10., inf))),
|
||||
(5, ((-inf, -inf, -inf), (inf, inf, inf))) )
|
||||
expected_results = ( (1, (( -4., -4., -np.inf),
|
||||
( 4., 4., np.inf))),
|
||||
(2, (( -7., -7., -np.inf),
|
||||
( 7., 7., np.inf))),
|
||||
(3, ((-10., -10., -np.inf),
|
||||
( 10., 10., np.inf))),
|
||||
(4, ((-10., -10., -np.inf),
|
||||
( 10., 10., np.inf))),
|
||||
(5, ((-np.inf, -np.inf, -np.inf),
|
||||
( np.inf, np.inf, np.inf))) )
|
||||
@pytest.mark.parametrize("cell_id,expected_box", expected_results)
|
||||
def test_cell_box(cell_id, expected_box):
|
||||
cell_box = openmc.capi.cells[cell_id].bounding_box
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue