1212from collections .abc import Mapping , Iterable
1313from numbers import Real , Integral
1414from warnings import warn
15+ from typing import List
1516
1617import lxml .etree as ET
1718import scipy .sparse as sp
@@ -244,6 +245,10 @@ class Chain:
244245 Reactions that are tracked in the depletion chain
245246 nuclide_dict : dict of str to int
246247 Maps a nuclide name to an index in nuclides.
248+ stable_nuclides : list of openmc.deplete.Nuclide
249+ List of stable nuclides available in the chain.
250+ unstable_nuclides : list of openmc.deplete.Nuclide
251+ List of unstable nuclides available in the chain.
247252 fission_yields : None or iterable of dict
248253 List of effective fission yields for materials. Each dictionary
249254 should be of the form ``{parent: {product: yield}}`` with
@@ -256,7 +261,7 @@ class Chain:
256261 """
257262
258263 def __init__ (self ):
259- self .nuclides = []
264+ self .nuclides : List [ Nuclide ] = []
260265 self .reactions = []
261266 self .nuclide_dict = {}
262267 self ._fission_yields = None
@@ -272,7 +277,18 @@ def __len__(self):
272277 """Number of nuclides in chain."""
273278 return len (self .nuclides )
274279
275- def add_nuclide (self , nuclide ):
280+
281+ @property
282+ def stable_nuclides (self ) -> List [Nuclide ]:
283+ """List of stable nuclides available in the chain"""
284+ return [nuc for nuc in self .nuclides if nuc .half_life is None ]
285+
286+ @property
287+ def unstable_nuclides (self ) -> List [Nuclide ]:
288+ """List of unstable nuclides available in the chain"""
289+ return [nuc for nuc in self .nuclides if nuc .half_life is not None ]
290+
291+ def add_nuclide (self , nuclide : Nuclide ):
276292 """Add a nuclide to the depletion chain
277293
278294 Parameters
0 commit comments