mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-25 20:45:35 -04:00
Update micro_xs regression test with update option
This commit is contained in:
parent
956e3f4341
commit
6a790df0be
1 changed files with 6 additions and 2 deletions
|
|
@ -4,9 +4,10 @@ from pathlib import Path
|
|||
import numpy as np
|
||||
import pytest
|
||||
import openmc
|
||||
|
||||
from openmc.deplete import MicroXS
|
||||
|
||||
from tests.regression_tests import config
|
||||
|
||||
CHAIN_FILE = Path(__file__).parents[2] / "chain_simple.xml"
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
|
|
@ -46,7 +47,10 @@ def model():
|
|||
|
||||
|
||||
def test_from_model(model):
|
||||
ref_xs = MicroXS.from_csv('test_reference.csv')
|
||||
test_xs = MicroXS.from_model(model, model.materials[0], CHAIN_FILE)
|
||||
if config['update']:
|
||||
test_xs.to_csv('test_reference.csv')
|
||||
|
||||
ref_xs = MicroXS.from_csv('test_reference.csv')
|
||||
|
||||
np.testing.assert_allclose(test_xs, ref_xs, rtol=1e-11)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue