Fixed per @paulromano comments

This commit is contained in:
Adam Nelson 2016-05-15 19:13:22 -04:00
parent 142033c260
commit e13bd5c853
3 changed files with 53 additions and 14 deletions

View file

@ -4,9 +4,10 @@ import copy
import pickle
from numbers import Integral
from collections import OrderedDict
import numpy as np
from warnings import warn
import numpy as np
import openmc
import openmc.mgxs
import openmc.checkvalue as cv
@ -759,7 +760,7 @@ class Library(object):
See also
--------
Library.create_mg_library(...)
Library.create_mg_library()
"""
@ -890,7 +891,7 @@ class Library(object):
See also
--------
Library.dump_to_file(mgxs_lib, filename, directory)
Library.dump_to_file()
"""
@ -922,9 +923,7 @@ class Library(object):
# support for higher orders are included in openmc.mgxs
order = 0
# Build storage for our XSdata objects
xsdatas = []
# Create the xsdata object and add it to the mgxs_file
for i, domain in enumerate(self.domains):
if self.by_nuclide:
nuclides = list(domain.get_all_nuclides().keys())
@ -943,10 +942,7 @@ class Library(object):
xs_type=xs_type, xs_id=xs_ids[i],
order=order)
xsdatas.append(xsdata)
# Add XSdatas to file
mgxs_file.add_xsdatas(xsdatas)
mgxs_file.add_xsdata(xsdata)
return mgxs_file
@ -977,7 +973,7 @@ class Library(object):
See also
--------
Library.create_mg_library(...)
Library.create_mg_library()
"""

View file

@ -367,7 +367,7 @@ class XSdata(object):
check_type('energy_groups', energy_groups, openmc.mgxs.EnergyGroups)
if energy_group.group_edges is None:
msg = 'Unable to assign an EnergyGroups object ' + \
msg = 'Unable to assign an EnergyGroups object ' \
'with uninitialized group edges'
raise ValueError(msg)
self._energy_groups = energy_groups
@ -518,7 +518,10 @@ class XSdata(object):
# Convert to a numpy array so we can easily get the shape for
# checking
npchi = np.asarray(chi)
check_value('chi shape', npchi.shape, [self.vector_shape])
# Check the shape
if npchi.shape != self.vector_shape:
msg = 'Provided chi iterable does not have the expected shape.'
raise ValueError(msg)
self._chi = npchi
@ -605,6 +608,11 @@ class XSdata(object):
Provide the macro or micro cross section in units of cm^-1 or
barns. Defaults to 'macro'.
See also
--------
openmc.mgxs.Library.create_mg_library()
openmc.mgxs.Library.get_xsdata
"""
check_type('total', total, (openmc.mgxs.TotalXS,
@ -636,6 +644,11 @@ class XSdata(object):
Provide the macro or micro cross section in units of cm^-1 or
barns. Defaults to 'macro'.
See also
--------
openmc.mgxs.Library.create_mg_library()
openmc.mgxs.Library.get_xsdata
"""
check_type('absorption', absorption, openmc.mgxs.AbsorptionXS)
@ -667,6 +680,11 @@ class XSdata(object):
Provide the macro or micro cross section in units of cm^-1 or
barns. Defaults to 'macro'.
See also
--------
openmc.mgxs.Library.create_mg_library()
openmc.mgxs.Library.get_xsdata
"""
check_type('fission', fission, openmc.mgxs.FissionXS)
@ -699,6 +717,11 @@ class XSdata(object):
Provide the macro or micro cross section in units of cm^-1 or
barns. Defaults to 'macro'.
See also
--------
openmc.mgxs.Library.create_mg_library()
openmc.mgxs.Library.get_xsdata
"""
# The NuFissionXS class does not have the capability to produce
@ -740,6 +763,11 @@ class XSdata(object):
Provide the macro or micro cross section in units of cm^-1 or
barns. Defaults to 'macro'.
See also
--------
openmc.mgxs.Library.create_mg_library()
openmc.mgxs.Library.get_xsdata
"""
check_type('k_fission', k_fission, openmc.mgxs.KappaFissionXS)
@ -770,6 +798,11 @@ class XSdata(object):
Provide the macro or micro cross section in units of cm^-1 or
barns. Defaults to 'macro'.
See also
--------
openmc.mgxs.Library.create_mg_library()
openmc.mgxs.Library.get_xsdata
"""
if self._use_chi is not None:
@ -810,6 +843,11 @@ class XSdata(object):
Provide the macro or micro cross section in units of cm^-1 or
barns. Defaults to 'macro'.
See also
--------
openmc.mgxs.Library.create_mg_library()
openmc.mgxs.Library.get_xsdata
"""
check_type('scatter', scatter, openmc.mgxs.ScatterMatrixXS)
@ -851,6 +889,11 @@ class XSdata(object):
Provide the macro or micro cross section in units of cm^-1 or
barns. Defaults to 'macro'.
See also
--------
openmc.mgxs.Library.create_mg_library()
openmc.mgxs.Library.get_xsdata
"""
check_type('nuscatter', nuscatter, openmc.mgxs.NuScatterMatrixXS)

View file

@ -118,7 +118,7 @@ contains
real(8), allocatable :: awrs(:)
integer, allocatable :: zaids(:)
! Use H5LT interface to write useful data from nuclide objects
! Write useful data from nuclide objects
nuclide_group = create_group(file_id, "nuclides")
call write_dataset(nuclide_group, "n_nuclides_total", n_nuclides_total)