From 923a609a90c0bff8ab554a4316968f1cebff8e99 Mon Sep 17 00:00:00 2001 From: "wbinventor@gmail.com" Date: Fri, 25 Mar 2016 17:52:52 -0400 Subject: [PATCH 1/2] Removed errant calls to get all nuclides from domain in MGXS class to permit user-specified nuclides --- openmc/mgxs/mgxs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openmc/mgxs/mgxs.py b/openmc/mgxs/mgxs.py index 2f8f729adc..26f2159815 100644 --- a/openmc/mgxs/mgxs.py +++ b/openmc/mgxs/mgxs.py @@ -441,7 +441,7 @@ class MGXS(object): cv.check_type('nuclide', nuclide, basestring) # Get list of all nuclides in the spatial domain - nuclides = self.domain.get_all_nuclides() + nuclides = self.get_all_nuclides() if nuclide not in nuclides: msg = 'Unable to get density for nuclide "{0}" which is not in ' \ @@ -553,7 +553,7 @@ class MGXS(object): # If this is a by-nuclide cross-section, add all nuclides to Tally if self.by_nuclide and score != 'flux': - all_nuclides = self.domain.get_all_nuclides() + all_nuclides = self.get_all_nuclides() for nuclide in all_nuclides: self.tallies[key].nuclides.append(nuclide) else: From f90c46d2f3c75fa777ed935cdef35e0edc66d75d Mon Sep 17 00:00:00 2001 From: Will Boyd Date: Mon, 28 Mar 2016 17:30:19 -0400 Subject: [PATCH 2/2] Cleaned up docstring for nuclides attribute of MGXS class for @paulromano --- openmc/mgxs/mgxs.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/openmc/mgxs/mgxs.py b/openmc/mgxs/mgxs.py index edc345e870..2b05bc7095 100644 --- a/openmc/mgxs/mgxs.py +++ b/openmc/mgxs/mgxs.py @@ -67,10 +67,6 @@ class MGXS(object): The energy group structure for energy condensation by_nuclide : bool If true, computes cross sections for each nuclide in domain - nuclides : Iterable of basestring - The user-specified nuclides to compute cross sections. If by_nuclide - is True but nuclides are not specified by the user, all nuclides in the - spatial domain will be used. name : str, optional Name of the multi-group cross section. Used as a label to identify tallies in OpenMC 'tallies.xml' file. @@ -109,9 +105,11 @@ class MGXS(object): num_nuclides : Integral The number of nuclides for which the multi-group cross section is being tracked. This is unity if the by_nuclide attribute is False. - nuclides : list of str or 'sum' - A list of nuclide string names (e.g., 'U-238', 'O-16') when by_nuclide - is True and 'sum' when by_nuclide is False. + nuclides : Iterable of str or 'sum' + The optional user-specified nuclides for which to compute cross + sections (e.g., 'U-238', 'O-16'). If by_nuclide is True but nuclides + are not specified by the user, all nuclides in the spatial domain + are included. This attribute is 'sum' if by_nuclide is false. sparse : bool Whether or not the MGXS' tallies use SciPy's LIL sparse matrix format for compressed data storage