From d10b83e06454b573e19e77375e46cb2a2040b423 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Thu, 8 Aug 2019 08:58:37 -0500 Subject: [PATCH] Document FissionYieldDistribution Pretty internal, but people may be curious --- docs/source/pythonapi/deplete.rst | 2 ++ openmc/deplete/nuclide.py | 14 +++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/docs/source/pythonapi/deplete.rst b/docs/source/pythonapi/deplete.rst index a72504ac9..243dcad43 100644 --- a/docs/source/pythonapi/deplete.rst +++ b/docs/source/pythonapi/deplete.rst @@ -65,6 +65,7 @@ for a depletion chain: DecayTuple Nuclide ReactionTuple + FissionYieldDistribution The following classes are used during a depletion simulation and store auxiliary data, such as number densities and reaction rates for each material. @@ -77,6 +78,7 @@ data, such as number densities and reaction rates for each material. AtomNumber ChainFissionHelper DirectReactionRateHelper + FissionYieldHelper OperatorResult ReactionRates Results diff --git a/openmc/deplete/nuclide.py b/openmc/deplete/nuclide.py index 8a0a9dc64..23f14331e 100644 --- a/openmc/deplete/nuclide.py +++ b/openmc/deplete/nuclide.py @@ -221,9 +221,17 @@ class Nuclide(object): class FissionYieldDistribution(Mapping): """Class for storing energy-dependent fission yields for a single nuclide + Can be used as a dictionary mapping energies and products to fission + yields:: + + >>> fydist = FissionYieldDistribution.from_dict({ + ... {0.0253: {"Xe135": 0.021}}) + >>> fydist[0.0253]["Xe135"] + 0.021 + Parameters ---------- - ordered_energies : iterable of real + ordered_energies : iterable of float Energies for which fission yield data exist orderded_products : iterable of str Fission products produced by this parent at all energies @@ -247,7 +255,7 @@ class FissionYieldDistribution(Mapping): See Also -------- - :meth:`from_xml`, :meth:`from_dict` + :meth:`from_xml_element`, :meth:`from_dict` """ def __init__(self, ordered_energies, ordered_products, group_fission_yields): @@ -354,7 +362,7 @@ class FissionYieldDistribution(Mapping): class _FissionYield(Mapping): """Mapping for fission yields of a parent at a specific energy - Abstracted to support nested dictionary-like behavior for + Separated to support nested dictionary-like behavior for :class:`FissionYieldDistribution`, and allowing math operations on a single vector of yields