From cdf58828af90ddb7f0f1ce41a0e4ede3113fa259 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 13 Jul 2020 16:28:22 -0500 Subject: [PATCH] Remove unused arguments on NormalizationHelper classes --- openmc/deplete/abc.py | 11 ++--------- openmc/deplete/helpers.py | 9 ++------- openmc/deplete/operator.py | 4 ++-- 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/openmc/deplete/abc.py b/openmc/deplete/abc.py index ac24e565ff..f07174a95b 100644 --- a/openmc/deplete/abc.py +++ b/openmc/deplete/abc.py @@ -335,7 +335,7 @@ class NormalizationHelper(ABC): self._energy = 0.0 @abstractmethod - def prepare(self, chain_nucs, rate_index, materials): + def prepare(self, chain_nucs, rate_index): """Perform work needed to obtain energy produced This method is called prior to the transport simulations @@ -348,13 +348,9 @@ class NormalizationHelper(ABC): rate_index : dict of str to int Mapping from nuclide name to index in the `fission_rates` for :meth:`update`. - materials : list of str - All materials tracked on the operator helped by this - object. Should correspond to - :attr:`openmc.deplete.Operator.burnable_materials` """ - def update(self, fission_rates, mat_index): + def update(self, fission_rates): """Update the energy produced Parameters @@ -363,9 +359,6 @@ class NormalizationHelper(ABC): fission reaction rate for each isotope in the specified material. Should be ordered corresponding to initial ``rate_index`` used in :meth:`prepare` - mat_index : int - Index for the specific material in the list of all burnable - materials. """ @property diff --git a/openmc/deplete/helpers.py b/openmc/deplete/helpers.py index 2c1afb4da8..204a214256 100644 --- a/openmc/deplete/helpers.py +++ b/openmc/deplete/helpers.py @@ -113,7 +113,7 @@ class ChainFissionHelper(NormalizationHelper): super().__init__() self._fission_q_vector = None - def prepare(self, chain_nucs, rate_index, _materials): + def prepare(self, chain_nucs, rate_index): """Populate the fission Q value vector from a chain. Parameters @@ -125,8 +125,6 @@ class ChainFissionHelper(NormalizationHelper): Dictionary mapping names of nuclides, e.g. ``"U235"``, to a corresponding index in the desired fission Q vector. - _materials : list of str - Unused. Materials to be tracked for this helper. """ if (self._fission_q_vector is not None and self._fission_q_vector.shape == (len(rate_index),)): @@ -143,7 +141,7 @@ class ChainFissionHelper(NormalizationHelper): self._fission_q_vector = fission_qs - def update(self, fission_rates, _mat_index): + def update(self, fission_rates): """Update energy produced with fission rates in a material Parameters @@ -152,9 +150,6 @@ class ChainFissionHelper(NormalizationHelper): fission reaction rate for each isotope in the specified material. Should be ordered corresponding to initial ``rate_index`` used in :meth:`prepare` - _mat_index : int - index for the material requested. Unused, as identical - isotopes in all materials have the same Q value. """ self._energy += dot(fission_rates, self._fission_q_vector) diff --git a/openmc/deplete/operator.py b/openmc/deplete/operator.py index b9d870d9db..05c9cf5e4e 100644 --- a/openmc/deplete/operator.py +++ b/openmc/deplete/operator.py @@ -492,7 +492,7 @@ class Operator(TransportOperator): for i in self.burnable_mats] self._rate_helper.generate_tallies(materials, self.chain.reactions) self._normalization_helper.prepare( - self.chain.nuclides, self.reaction_rates.index_nuc, materials) + self.chain.nuclides, self.reaction_rates.index_nuc) # Tell fission yield helper what materials this process is # responsible for self._yield_helper.generate_tallies( @@ -672,7 +672,7 @@ class Operator(TransportOperator): fission_yields.append(self._yield_helper.weighted_yields(i)) # Accumulate energy from fission - self._normalization_helper.update(tally_rates[:, fission_ind], mat_index) + self._normalization_helper.update(tally_rates[:, fission_ind]) # Divide by total number and store rates[i] = self._rate_helper.divide_by_adens(number)