mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Convert dtye from mixed to a float for comparison assertion
This commit is contained in:
parent
a9af38a4dd
commit
9fa68075c6
1 changed files with 6 additions and 2 deletions
|
|
@ -75,10 +75,14 @@ class SurfaceSourceTestHarness(PyAPITestHarness):
|
|||
if self._model.settings.surf_src_write:
|
||||
with h5py.File("surface_source_true.h5", 'r') as f:
|
||||
src_true = f['source_bank'][()]
|
||||
# Convert dtye from mixed to a float for comparison assertion
|
||||
src_true.dtype = 'float64'
|
||||
with h5py.File("surface_source.h5", 'r') as f:
|
||||
src_test = f['source_bank'][()]
|
||||
for (true_p, test_p) in zip(np.sort(src_true), np.sort(src_test)):
|
||||
np.testing.assert_array_equal(true_p, test_p)
|
||||
# Convert dtye from mixed to a float for comparison assertion
|
||||
src_test.dtype = 'float64'
|
||||
np.testing.assert_allclose(np.sort(src_true), np.sort(src_test),
|
||||
atol=1e-07)
|
||||
|
||||
def execute_test(self):
|
||||
"""Build input XMLs, run OpenMC, check output and results."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue