From 1e5cfe09613cf8260840d56900408702e662eba8 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Thu, 22 Aug 2019 15:32:45 -0500 Subject: [PATCH] Return list of str from FY helpers update_tally_nuclides --- openmc/deplete/abc.py | 8 ++++---- tests/unit_tests/test_deplete_fission_yields.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/openmc/deplete/abc.py b/openmc/deplete/abc.py index 16d2d7abbd..fb638e5c21 100644 --- a/openmc/deplete/abc.py +++ b/openmc/deplete/abc.py @@ -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 diff --git a/tests/unit_tests/test_deplete_fission_yields.py b/tests/unit_tests/test_deplete_fission_yields.py index 2842043d12..d3faec35bf 100644 --- a/tests/unit_tests/test_deplete_fission_yields.py +++ b/tests/unit_tests/test_deplete_fission_yields.py @@ -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