Respond to reviewer comments on FY helpers

- Change Operator attribute name for fission yield helper
- Use copy.deepcopy for constant_yields, fast_yields, and thermal_yields
- Change import location of openmc in tests
- Use bisect.bisect_left to find replacement fission yields on
  FissionYieldCutoffHelper if thermal or fast energies not found
This commit is contained in:
Andrew Johnson 2019-08-21 10:05:59 -05:00
parent 6735657cb3
commit b19a2db0ee
No known key found for this signature in database
GPG key ID: 253418E91B7F6FEB
6 changed files with 37 additions and 60 deletions

View file

@ -5,7 +5,6 @@ from unittest.mock import Mock
import pytest
import numpy
from openmc.deplete.nuclide import Nuclide, FissionYieldDistribution
from openmc.deplete.helpers import (
FissionYieldCutoffHelper, ConstantFissionYieldHelper,
@ -75,10 +74,10 @@ def test_cutoff_construction(nuclide_bundle):
"U235": nuclide_bundle.u235.yield_data[0.0253]}
assert helper.fast_yields == {"U235": nuclide_bundle.u235.yield_data[5e5]}
# test failures in cutoff: super low, super high
with pytest.raises(ValueError, match="thermal yields"):
with pytest.raises(ValueError, match="replacement fission yields"):
FissionYieldCutoffHelper(
nuclide_bundle, 1, thermal_energy=0.001, cutoff=0.002)
with pytest.raises(ValueError, match="fast yields"):
with pytest.raises(ValueError, match="replacement fission yields"):
FissionYieldCutoffHelper(
nuclide_bundle, 1, cutoff=15e6, fast_energy=17e6)

View file

@ -4,7 +4,6 @@ import xml.etree.ElementTree as ET
import numpy
import pytest
from openmc.deplete import nuclide