Skip to content

Commit 652a34e

Browse files
committed
docstring fixes
1 parent b4ce1f3 commit 652a34e

3 files changed

Lines changed: 67 additions & 8 deletions

File tree

examples/msbr/openmc_msbr_model.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,17 @@ def parse_arguments():
5151
-------
5252
deplete : bool
5353
Flag indicated whether or not to run a depletion simulation.
54-
volume : bool
54+
volume_calculation : bool
5555
Flag indicating whether or not to run a stochastic volume calcuation.
56+
entropy : bool
57+
Flag indicating whether or not to calculate Shannon entropy.
5658
"""
5759
parser = argparse.ArgumentParser()
5860
parser.add_argument('--deplete',
5961
type=bool,
6062
default=False,
6163
help='flag for running depletion')
62-
parser.add_argument('--volume',
64+
parser.add_argument('--volume_calculation',
6365
type=bool,
6466
default=False,
6567
help='flag for running stochastic volume calculation')
@@ -71,7 +73,7 @@ def parse_arguments():
7173

7274

7375
args = parser.parse_args()
74-
return bool(args.deplete), bool(args.volume), bool(args.entropy)
76+
return bool(args.deplete), bool(args.volume_calculation), bool(args.entropy)
7577

7678
def shared_elem_geometry(elem_type='core',
7779
gr_sq_d=4.953,
@@ -384,7 +386,7 @@ def plot_geometry(name,
384386
return plot
385387

386388

387-
deplete, volume, entropy = parse_arguments()
389+
deplete, volume_calculation, entropy = parse_arguments()
388390

389391
(zone_bounds,
390392
core_bounds,
@@ -470,7 +472,7 @@ def plot_geometry(name,
470472
'range': (800, 1000)}
471473

472474
ll, ur = geo.root_universe.bounding_box
473-
if volume:
475+
if volume_calculation:
474476
msbr_volume_calc = openmc.VolumeCalculation([fuel, moder], int(1e10), ll, ur)
475477
#msbr_volume_calc.set_trigger(1e-03, 'rel_err')
476478
settings.volume_calculations = [msbr_volume_calc]

saltproc/openmc_depcode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def _create_mass_percents_dictionary(self, mat, percent_type='ao'):
314314
mat : openmc.Material
315315
A material
316316
percent_type : str
317-
Percent type of material,
317+
Percent type of material
318318
319319
Returns
320320
-------

saltproc/simulation.py

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,33 @@ def store_after_repr(self, after_mats, waste_dict, dep_step):
171171

172172
def _fix_nuclide_discrepancy(self, db, earr, iso_idx, iso_wt_frac):
173173
"""Fix discrepancies between nuclide keys present in stored results and
174-
nuclides keys stored in results for the current depletion step """
174+
nuclides keys stored in results for the current depletion step
175+
176+
Parameters
177+
----------
178+
db : tables.File
179+
The SaltProc results database
180+
earr : tables.EArray
181+
Array storing nuclide material mass compositions from previously
182+
completed depletion steps
183+
iso_idx : OrderedDict
184+
Map of nuclide name to array index
185+
iso_wt_frac : list of float
186+
List storing nuclide material mass compositions for current
187+
depletion step.
188+
189+
Returns
190+
-------
191+
earr : tables.EArray
192+
Array storing nuclide material mass compositions from
193+
previously completed depletion steps with additional
194+
rows for nuclides introduces in iso_wt_frac
195+
iso_wt_frac : list of float
196+
List storing nuclide material mass compositions for current
197+
depletion step with additional entries for nuclides not present
198+
in the current depletion step that are stored in earr.
199+
"""
200+
175201
base_nucs= set(earr.attrs.iso_map.keys())
176202
step_nucs = set(iso_idx.keys())
177203
forward_difference = base_nucs.difference(step_nucs)
@@ -205,7 +231,38 @@ def _fix_nuclide_discrepancy(self, db, earr, iso_idx, iso_wt_frac):
205231

206232
def _add_missing_nuclides(self, base_nucs, step_nucs, earr, iso_idx, iso_wt_frac):
207233
"""Add missing nuclides to stored results and the results for the
208-
current depletion step"""
234+
current depletion step
235+
236+
Parameters
237+
----------
238+
base_nucs : set
239+
Nuclides present in previous depletion steps
240+
step_nucs : set
241+
Nuclides present in current depletion step
242+
earr : tables.EArray
243+
Array storing nuclide material mass compositions from previously
244+
completed depletion steps
245+
iso_idx : OrderedDict
246+
Map of nuclide name to array index
247+
iso_wt_frac : list of float
248+
List storing nuclide material mass compositions for current
249+
depletion step.
250+
251+
Returns
252+
-------
253+
combined_nucs : numpy.ndarray
254+
Nuclide-code sorted union of base_nucs and step_nucs
255+
combined_map : OrderedDict
256+
Map of nuclide names to array index
257+
combined_earr : numpy.ndarray
258+
Array storing nuclide material mass compositions from
259+
previously completed depletion steps with additional
260+
rows for nuclides introduces in iso_wt_frac
261+
combined_step_arr : numpy.ndarray
262+
Array storing nuclide material mass compositions for current
263+
depletion step with additional entries for nuclides not present
264+
in the current depletion step that are stored in earr.
265+
"""
209266
combined_nucs = list(base_nucs.union(step_nucs))
210267
# Sort the nucnames by ZAM
211268
nuccodes = list(map(self.sim_depcode._convert_name_to_nuccode, combined_nucs))

0 commit comments

Comments
 (0)