Return list of str from FY helpers update_tally_nuclides

This commit is contained in:
Andrew Johnson 2019-08-22 15:32:45 -05:00
parent 61232248df
commit 1e5cfe0961
No known key found for this signature in database
GPG key ID: 253418E91B7F6FEB
2 changed files with 6 additions and 6 deletions

View file

@ -458,13 +458,13 @@ class FissionYieldHelper(ABC):
Returns
-------
nuclides : tuple of str
nuclides : list of str
Union of nuclides that the :class:`openmc.deplete.Operator`
says have non-zero densities at this stage and those that
have yield data. Sorted by nuclide name
"""
return tuple(sorted(self._chain_set & set(nuclides)))
return sorted(self._chain_set & set(nuclides))
@classmethod
def from_operator(cls, operator, **kwargs):
@ -550,7 +550,7 @@ class TalliedFissionYieldHelper(FissionYieldHelper):
Returns
-------
nuclides : tuple of str
nuclides : list of str
Union of input nuclides and those that have multiple sets
of yield data. Sorted by nuclide name
@ -562,7 +562,7 @@ class TalliedFissionYieldHelper(FissionYieldHelper):
assert self._fission_rate_tally is not None, (
"Run generate_tallies first")
overlap = set(self._chain_nuclides).intersection(set(nuclides))
nuclides = tuple(sorted(overlap))
nuclides = sorted(overlap)
self._tally_nucs = [self._chain_nuclides[n] for n in nuclides]
self._fission_rate_tally.nuclides = nuclides
return nuclides

View file

@ -206,7 +206,7 @@ def test_cutoff_helper(materials, nuclide_bundle, therm_frac):
non_zero_nucs = [n.name for n in nuclide_bundle]
tally_nucs = helper.update_tally_nuclides(non_zero_nucs)
assert tally_nucs == ("Pu239", "U235",)
assert tally_nucs == ["Pu239", "U235",]
# Check tallies
fission_tally = helper._fission_rate_tally
@ -249,7 +249,7 @@ def test_averaged_helper(materials, nuclide_bundle, avg_energy):
helper.generate_tallies(materials, [0])
tallied_nucs = helper.update_tally_nuclides(
[n.name for n in nuclide_bundle])
assert tallied_nucs == ("Pu239", "U235")
assert tallied_nucs == ["Pu239", "U235"]
# check generated tallies
fission_tally = helper._fission_rate_tally