diff --git a/.gitignore b/.gitignore index 815e97851..f0378dfc6 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ examples/python/**/*.xml docs/build docs/source/_images/*.pdf docs/source/_images/*.aux +docs/source/pythonapi/generated/ # Source build build diff --git a/docs/source/_templates/myclass.rst b/docs/source/_templates/myclass.rst new file mode 100644 index 000000000..a0560f93a --- /dev/null +++ b/docs/source/_templates/myclass.rst @@ -0,0 +1,7 @@ +{{ fullname }} +{{ underline }} + +.. currentmodule:: {{ module }} + +.. autoclass:: {{ objname }} + :members: diff --git a/docs/source/conf.py b/docs/source/conf.py index 6ca551a43..3bf5b0b1e 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -24,13 +24,8 @@ except ImportError: from mock import Mock as MagicMock -class Mock(MagicMock): - @classmethod - def __getattr__(cls, name): - return Mock() - MOCK_MODULES = ['numpy', 'h5py', 'pandas', 'opencg'] -sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES) +sys.modules.update((mod_name, MagicMock()) for mod_name in MOCK_MODULES) # If extensions (or modules to document with autodoc) are in another directory, @@ -48,6 +43,7 @@ extensions = ['sphinx.ext.autodoc', 'sphinx.ext.napoleon', 'sphinx.ext.mathjax', 'sphinx.ext.autosummary', + 'sphinx.ext.intersphinx', 'sphinx_numfig', 'notebook_sphinxext'] @@ -65,7 +61,7 @@ master_doc = 'index' # General information about the project. project = u'OpenMC' -copyright = u'2011-2015, Massachusetts Institute of Technology' +copyright = u'2011-2016, Massachusetts Institute of Technology' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -122,20 +118,13 @@ pygments_style = 'tango' # -- Options for HTML output --------------------------------------------------- -# The theme to use for HTML and HTML Help pages. Major themes that come with -# Sphinx are currently 'default' and 'sphinxdoc'. -if on_rtd: - html_theme = 'default' - html_logo = '_images/openmc200px.png' -else: - html_theme = 'haiku' - html_theme_options = {'full_logo': True, - 'linkcolor': '#0c3762', - 'visitedlinkcolor': '#0c3762'} - html_logo = '_images/openmc.png' +# The theme to use for HTML and HTML Help pages +if not on_rtd: + import sphinx_rtd_theme + html_theme = 'sphinx_rtd_theme' + html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] -# Add any paths that contain custom themes here, relative to this directory. -#html_theme_path = ["_theme"] +html_logo = '_images/openmc200px.png' # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". @@ -248,4 +237,12 @@ latex_elements = { #Autodocumentation Flags #autodoc_member_order = "groupwise" #autoclass_content = "both" -#autosummary_generate = [] +autosummary_generate = True + +napoleon_use_ivar = True + +intersphinx_mapping = { + 'python': ('https://docs.python.org/3', None), + 'numpy': ('http://docs.scipy.org/doc/numpy/', None), + 'pandas': ('http://pandas.pydata.org/pandas-docs/stable/', None) +} diff --git a/docs/source/pythonapi/ace.rst b/docs/source/pythonapi/ace.rst deleted file mode 100644 index 4810ec4bb..000000000 --- a/docs/source/pythonapi/ace.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. _pythonapi_ace: - -========== -ACE Format -========== - -.. automodule:: openmc.ace - :members: diff --git a/docs/source/pythonapi/cmfd.rst b/docs/source/pythonapi/cmfd.rst deleted file mode 100644 index 51470069f..000000000 --- a/docs/source/pythonapi/cmfd.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. _pythonapi_cmfd: - -==== -CMFD -==== - -.. automodule:: openmc.cmfd - :members: diff --git a/docs/source/pythonapi/element.rst b/docs/source/pythonapi/element.rst deleted file mode 100644 index 473cbba45..000000000 --- a/docs/source/pythonapi/element.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. _pythonapi_element: - -======= -Element -======= - -.. automodule:: openmc.element - :members: diff --git a/docs/source/pythonapi/executor.rst b/docs/source/pythonapi/executor.rst deleted file mode 100644 index ef6693ec9..000000000 --- a/docs/source/pythonapi/executor.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. _pythonapi_executor: - -======== -Executor -======== - -.. automodule:: openmc.executor - :members: diff --git a/docs/source/pythonapi/filter.rst b/docs/source/pythonapi/filter.rst deleted file mode 100644 index f93ba5a15..000000000 --- a/docs/source/pythonapi/filter.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. _pythonapi_filter: - -====== -Filter -====== - -.. automodule:: openmc.filter - :members: diff --git a/docs/source/pythonapi/geometry.rst b/docs/source/pythonapi/geometry.rst deleted file mode 100644 index 6b87edb97..000000000 --- a/docs/source/pythonapi/geometry.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. _pythonapi_geometry: - -======== -Geometry -======== - -.. automodule:: openmc.geometry - :members: diff --git a/docs/source/pythonapi/index.rst b/docs/source/pythonapi/index.rst index 864b48c55..3e0d8a418 100644 --- a/docs/source/pythonapi/index.rst +++ b/docs/source/pythonapi/index.rst @@ -13,61 +13,261 @@ online. We recommend going through the modules from Codecademy_ and/or the `Scipy lectures`_. The full API documentation serves to provide more information on a given module or class. -**Handling nuclear data:** +------------------------------------ +:mod:`openmc` -- Basic Functionality +------------------------------------ -.. toctree:: - :maxdepth: 1 +Handling nuclear data +--------------------- - ace - mgxs_library +Classes ++++++++ -**Creating input files:** +.. autosummary:: + :toctree: generated + :nosignatures: + :template: myclass.rst -.. toctree:: - :maxdepth: 1 + openmc.XSdata + openmc.MGXSLibraryFile - cmfd - element - filter - geometry - material - mesh - nuclide - opencg_compatible - plots - settings - source - stats - surface - tallies - trigger - universe +Functions ++++++++++ -**Running OpenMC:** +.. autosummary:: + :toctree: generated + :nosignatures: -.. toctree:: - :maxdepth: 1 + openmc.ace.ascii_to_binary - executor +Simulation Settings +------------------- -**Post-processing:** +.. autosummary:: + :toctree: generated + :nosignatures: + :template: myclass.rst -.. toctree:: - :maxdepth: 1 + openmc.Source + openmc.ResonanceScattering + openmc.SettingsFile - particle_restart - statepoint - summary - tallies +Material Specification +---------------------- -**Multi-Group Cross Section Generation** +.. autosummary:: + :toctree: generated + :nosignatures: + :template: myclass.rst -.. toctree:: - :maxdepth: 1 + openmc.Nuclide + openmc.Element + openmc.Macroscopic + openmc.Material + openmc.MaterialsFile - mgxs +Building geometry +----------------- -**Example Jupyter Notebooks:** +.. autosummary:: + :toctree: generated + :nosignatures: + :template: myclass.rst + + openmc.XPlane + openmc.YPlane + openmc.ZPlane + openmc.XCylinder + openmc.YCylinder + openmc.ZCylinder + openmc.Sphere + openmc.Halfspace + openmc.Intersection + openmc.Union + openmc.Complement + openmc.Cell + openmc.Universe + openmc.RectLattice + openmc.HexLattice + openmc.Geometry + openmc.GeometryFile + +Many of the above classes are derived from several abstract classes: + +.. autosummary:: + :toctree: generated + :nosignatures: + :template: myclass.rst + + openmc.Surface + openmc.Region + openmc.Lattice + +Constructing Tallies +-------------------- + +.. autosummary:: + :toctree: generated + :nosignatures: + :template: myclass.rst + + openmc.Filter + openmc.Mesh + openmc.Trigger + openmc.Tally + openmc.TalliesFile + +Coarse Mesh Finite Difference Acceleration +------------------------------------------ + +.. autosummary:: + :toctree: generated + :nosignatures: + :template: myclass.rst + + openmc.CMFDMesh + openmc.CMFDFile + +Plotting +-------- + +.. autosummary:: + :toctree: generated + :nosignatures: + :template: myclass.rst + + openmc.Plot + openmc.PlotsFile + +Running OpenMC +-------------- + +.. autosummary:: + :toctree: generated + :nosignatures: + :template: myclass.rst + + openmc.Executor + +Post-processing +--------------- + +.. autosummary:: + :toctree: generated + :nosignatures: + :template: myclass.rst + + openmc.Particle + openmc.StatePoint + openmc.Summary + +Various classes may be created when performing tally slicing and/or arithmetic: + +.. autosummary:: + :toctree: generated + :nosignatures: + :template: myclass.rst + + openmc.CrossScore + openmc.CrossNuclide + openmc.CrossFilter + openmc.AggregateScore + openmc.AggregateNuclide + openmc.AggregateFilter + +--------------------------------- +:mod:`openmc.stats` -- Statistics +--------------------------------- + +Univariate Probability Distributions +------------------------------------ + +.. autosummary:: + :toctree: generated + :nosignatures: + :template: myclass.rst + + openmc.stats.Univariate + openmc.stats.Discrete + openmc.stats.Uniform + openmc.stats.Maxwell + openmc.stats.Watt + openmc.stats.Tabular + +Angular Distributions +--------------------- + +.. autosummary:: + :toctree: generated + :nosignatures: + :template: myclass.rst + + openmc.stats.UnitSphere + openmc.stats.PolarAzimuthal + openmc.stats.Isotropic + openmc.stats.Monodirectional + +Spatial Distributions +--------------------- + +.. autosummary:: + :toctree: generated + :nosignatures: + :template: myclass.rst + + openmc.stats.Spatial + openmc.stats.CartesianIndependent + openmc.stats.Box + openmc.stats.Point + +---------------------------------------------------------- +:mod:`openmc.mgxs` -- Multi-Group Cross Section Generation +---------------------------------------------------------- + +Energy Groups +------------- + +.. autosummary:: + :toctree: generated + :nosignatures: + :template: myclass.rst + + openmc.mgxs.EnergyGroups + +Multi-group Cross Sections +-------------------------- + +.. autosummary:: + :toctree: generated + :nosignatures: + :template: myclass.rst + + openmc.mgxs.MGXS + openmc.mgxs.AbsorptionXS + openmc.mgxs.CaptureXS + openmc.mgxs.Chi + openmc.mgxs.FissionXS + openmc.mgxs.NuFissionXS + openmc.mgxs.NuScatterXS + openmc.mgxs.NuScatterMatrixXS + openmc.mgxs.ScatterXS + openmc.mgxs.ScatterMatrixXS + openmc.mgxs.TotalXS + openmc.mgxs.TransportXS + +Multi-group Cross Section Libraries +----------------------------------- + +.. autosummary:: + :toctree: generated + :nosignatures: + :template: myclass.rst + + openmc.mgxs.Library + +------------------------- +Example Jupyter Notebooks +------------------------- .. toctree:: :maxdepth: 1 diff --git a/docs/source/pythonapi/material.rst b/docs/source/pythonapi/material.rst deleted file mode 100644 index 16a3af701..000000000 --- a/docs/source/pythonapi/material.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. _pythonapi_material: - -========= -Materials -========= - -.. automodule:: openmc.material - :members: diff --git a/docs/source/pythonapi/mesh.rst b/docs/source/pythonapi/mesh.rst deleted file mode 100644 index dbecd7c31..000000000 --- a/docs/source/pythonapi/mesh.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. _pythonapi_mesh: - -==== -Mesh -==== - -.. automodule:: openmc.mesh - :members: diff --git a/docs/source/pythonapi/mgxs.rst b/docs/source/pythonapi/mgxs.rst deleted file mode 100644 index 2a0bb52ba..000000000 --- a/docs/source/pythonapi/mgxs.rst +++ /dev/null @@ -1,95 +0,0 @@ -.. _pythonapi_mgxs: - -========================== -Multi-Group Cross Sections -========================== - ----------------------------- -Summary of Available Classes ----------------------------- - -Energy Groups -------------- - -.. currentmodule:: openmc.mgxs.groups - -.. autosummary:: - - EnergyGroups - -Multi-group Cross Sections --------------------------- - -.. currentmodule:: openmc.mgxs.mgxs - -.. autosummary:: - - MGXS - AbsorptionXS - CaptureXS - Chi - FissionXS - NuFissionXS - NuScatterXS - NuScatterMatrixXS - ScatterXS - ScatterMatrixXS - TotalXS - TransportXS - -Multi-group Cross Section Libraries ------------------------------------ - -.. currentmodule:: openmc.mgxs.library - -.. autosummary:: - - Library - -------------------- -Class Documentation -------------------- - -.. automodule:: openmc.mgxs.groups - :members: - -.. currentmodule:: openmc.mgxs.mgxs - -.. autoclass:: MGXS - :members: - -.. autoclass:: AbsorptionXS - :members: - -.. autoclass:: CaptureXS - :members: - -.. autoclass:: Chi - :members: - -.. autoclass:: FissionXS - :members: - -.. autoclass:: NuFissionXS - :members: - -.. autoclass:: NuScatterXS - :members: - -.. autoclass:: NuScatterMatrixXS - :members: - -.. autoclass:: ScatterXS - :members: - -.. autoclass:: ScatterMatrixXS - :members: - -.. autoclass:: TotalXS - :members: - -.. autoclass:: TransportXS - :members: - -.. automodule:: openmc.mgxs.library - :members: diff --git a/docs/source/pythonapi/mgxs_library.rst b/docs/source/pythonapi/mgxs_library.rst deleted file mode 100644 index bdcdc364c..000000000 --- a/docs/source/pythonapi/mgxs_library.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. _pythonapi_mgxs_library: - -============================== -Multi-group Cross Section Data -============================== - -.. automodule:: openmc.mgxs_library - :members: diff --git a/docs/source/pythonapi/nuclide.rst b/docs/source/pythonapi/nuclide.rst deleted file mode 100644 index 9e3214e92..000000000 --- a/docs/source/pythonapi/nuclide.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. _pythonapi_nuclide: - -======= -Nuclide -======= - -.. automodule:: openmc.nuclide - :members: diff --git a/docs/source/pythonapi/particle_restart.rst b/docs/source/pythonapi/particle_restart.rst deleted file mode 100644 index 66ed89988..000000000 --- a/docs/source/pythonapi/particle_restart.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. _pythonapi_particle_restart: - -================ -Particle Restart -================ - -.. automodule:: openmc.particle_restart - :members: diff --git a/docs/source/pythonapi/plots.rst b/docs/source/pythonapi/plots.rst deleted file mode 100644 index 8ad5348be..000000000 --- a/docs/source/pythonapi/plots.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. _pythonapi_plots: - -===== -Plots -===== - -.. automodule:: openmc.plots - :members: diff --git a/docs/source/pythonapi/settings.rst b/docs/source/pythonapi/settings.rst deleted file mode 100644 index 3a3915ff5..000000000 --- a/docs/source/pythonapi/settings.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. _pythonapi_settings: - -======== -Settings -======== - -.. automodule:: openmc.settings - :members: diff --git a/docs/source/pythonapi/source.rst b/docs/source/pythonapi/source.rst deleted file mode 100644 index 4bc770363..000000000 --- a/docs/source/pythonapi/source.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. _pythonapi_source: - -====== -Source -====== - -.. automodule:: openmc.source - :members: diff --git a/docs/source/pythonapi/statepoint.rst b/docs/source/pythonapi/statepoint.rst deleted file mode 100644 index 737fc03fc..000000000 --- a/docs/source/pythonapi/statepoint.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. _pythonapi_statepoint: - -========== -Statepoint -========== - -.. automodule:: openmc.statepoint - :members: diff --git a/docs/source/pythonapi/stats.rst b/docs/source/pythonapi/stats.rst deleted file mode 100644 index 58060cacb..000000000 --- a/docs/source/pythonapi/stats.rst +++ /dev/null @@ -1,58 +0,0 @@ -.. _pythonapi_stats: - -===================== -Statistical Functions -===================== - ----------------------------- -Summary of Available Classes ----------------------------- - -Univariate Probability Distributions ------------------------------------- - -.. currentmodule:: openmc.stats.univariate - -.. autosummary:: - - Univariate - Discrete - Uniform - Maxwell - Watt - Tabular - -Angular Distributions ---------------------- - -.. currentmodule:: openmc.stats.multivariate - -.. autosummary:: - - UnitSphere - PolarAzimuthal - Isotropic - Monodirectional - -Spatial Distributions ---------------------- - -.. autosummary:: - - Spatial - CartesianIndependent - Box - Point - - -Univariate Probability Distributions ------------------------------------- - -.. automodule:: openmc.stats.univariate - :members: - -Multivariate Probability Distributions --------------------------------------- - -.. automodule:: openmc.stats.multivariate - :members: diff --git a/docs/source/pythonapi/summary.rst b/docs/source/pythonapi/summary.rst deleted file mode 100644 index 9a791127b..000000000 --- a/docs/source/pythonapi/summary.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. _pythonapi_summary: - -======= -Summary -======= - -.. automodule:: openmc.summary - :members: diff --git a/docs/source/pythonapi/surface.rst b/docs/source/pythonapi/surface.rst deleted file mode 100644 index cc31f5b3e..000000000 --- a/docs/source/pythonapi/surface.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. _pythonapi_surface: - -======= -Surface -======= - -.. automodule:: openmc.surface - :members: diff --git a/docs/source/pythonapi/tallies.rst b/docs/source/pythonapi/tallies.rst deleted file mode 100644 index 2f24edf3a..000000000 --- a/docs/source/pythonapi/tallies.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. _pythonapi_tallies: - -======= -Tallies -======= - -.. automodule:: openmc.tallies - :members: diff --git a/docs/source/pythonapi/trigger.rst b/docs/source/pythonapi/trigger.rst deleted file mode 100644 index 82567c2cf..000000000 --- a/docs/source/pythonapi/trigger.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. _pythonapi_trigger: - -======= -Trigger -======= - -.. automodule:: openmc.trigger - :members: diff --git a/docs/source/pythonapi/universe.rst b/docs/source/pythonapi/universe.rst deleted file mode 100644 index fd4a3c1e2..000000000 --- a/docs/source/pythonapi/universe.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. _pythonapi_universe: - -======== -Universe -======== - -.. automodule:: openmc.universe - :members: diff --git a/docs/source/usersguide/processing.rst b/docs/source/usersguide/processing.rst index b18569ec6..059659dbc 100644 --- a/docs/source/usersguide/processing.rst +++ b/docs/source/usersguide/processing.rst @@ -196,10 +196,10 @@ Data Extraction A great deal of information is available in statepoint files (See :ref:`usersguide_statepoint`), all of which is accessible through the Python -API. The ``openmc.statepoint`` module (see :ref:`pythonapi_statepoint`) provides -a class to load statepoints and access data as requested; it is used in many of -the provided plotting utilities, OpenMC's regression test suite, and can be used -in user-created scripts to carry out manipulations of the data. +API. The :class:`openmc.StatePoint` class can load statepoints and access data +as requested; it is used in many of the provided plotting utilities, OpenMC's +regression test suite, and can be used in user-created scripts to carry out +manipulations of the data. An :ref:`example IPython notebook ` demonstrates how to extract data from a statepoint using the Python API. diff --git a/openmc/__init__.py b/openmc/__init__.py index 9a39bcb82..b6a93c0a4 100644 --- a/openmc/__init__.py +++ b/openmc/__init__.py @@ -20,6 +20,8 @@ from openmc.statepoint import * from openmc.summary import * from openmc.region import * from openmc.source import * +from openmc.particle_restart import * +from openmc.arithmetic import * try: from openmc.opencg_compatible import * diff --git a/openmc/cell.py b/openmc/cell.py index a5204f2c1..c138f3044 100644 --- a/openmc/cell.py +++ b/openmc/cell.py @@ -44,15 +44,15 @@ class Cell(object): Unique identifier for the cell name : str Name of the cell - fill : Material or Universe or Lattice or 'void' or iterable of Material + fill : openmc.Material or openmc.Universe or openmc.Lattice or 'void' or iterable of openmc.Material Indicates what the region of space is filled with - region : openmc.region.Region + region : openmc.Region Region of space that is assigned to the cell. - rotation : ndarray + rotation : numpy.ndarray If the cell is filled with a universe, this array specifies the angles in degrees about the x, y, and z axes that the filled universe should be rotated. - translation : ndarray + translation : numpy.ndarray If the cell is filled with a universe, this array specifies a vector that is used to translate (shift) the universe. offsets : ndarray @@ -255,12 +255,12 @@ class Cell(object): cell. .. deprecated:: 0.7.1 - Use the Cell.region property to directly specify a Region + Use the :attr:`Cell.region` property to directly specify a Region expression. Parameters ---------- - surface : openmc.surface.Surface + surface : openmc.Surface Quadric surface dividing space halfspace : {-1, 1} Indicate whether the negative or positive half-space is to be used diff --git a/openmc/cmfd.py b/openmc/cmfd.py index c247719c9..b9977a288 100644 --- a/openmc/cmfd.py +++ b/openmc/cmfd.py @@ -69,7 +69,7 @@ class CMFDMesh(object): to any tallies far away from fission source neutron regions. A ``2`` must be used to identify any fission source region. -""" + """ def __init__(self): self._lower_left = None @@ -219,7 +219,7 @@ class CMFDFile(object): inner tolerance for Gauss-Seidel iterations when performing CMFD. ktol : float Tolerance on the eigenvalue when performing CMFD power iteration - cmfd_mesh : CMFDMesh + cmfd_mesh : openmc.CMFDMesh Structured mesh to be used for acceleration norm : float Normalization factor applied to the CMFD fission source distribution diff --git a/openmc/element.py b/openmc/element.py index dda110ea7..219aafbdf 100644 --- a/openmc/element.py +++ b/openmc/element.py @@ -24,7 +24,7 @@ class Element(object): Chemical symbol of the element, e.g. Pu xs : str Cross section identifier, e.g. 71c - scattering : 'data' or 'iso-in-lab' or None + scattering : {'data', 'iso-in-lab', None} The type of angular scattering distribution to use """ diff --git a/openmc/filter.py b/openmc/filter.py index 4bc17afca..037062a4c 100644 --- a/openmc/filter.py +++ b/openmc/filter.py @@ -40,7 +40,7 @@ class Filter(object): The bins for the filter num_bins : Integral The number of filter bins - mesh : Mesh or None + mesh : openmc.Mesh or None A Mesh object for 'mesh' type filters. stride : Integral The number of filter, nuclide and score bins within each of this @@ -265,7 +265,7 @@ class Filter(object): Parameters ---------- - other : Filter + other : openmc.Filter Filter to compare with Returns @@ -310,12 +310,12 @@ class Filter(object): Parameters ---------- - other : Filter + other : openmc.Filter Filter to merge with Returns ------- - merged_filter : Filter + merged_filter : openmc.Filter Filter resulting from the merge """ @@ -355,7 +355,7 @@ class Filter(object): Parameters ---------- - other : Filter + other : openmc.Filter The filter to query as a subset of this filter Returns @@ -519,8 +519,8 @@ class Filter(object): """Builds a Pandas DataFrame for the Filter's bins. This method constructs a Pandas DataFrame object for the filter with - columns annotated by filter bin information. This is a helper method - for the Tally.get_pandas_dataframe(...) method. + columns annotated by filter bin information. This is a helper method for + :math:`Tally.get_pandas_dataframe`. This capability has been tested for Pandas >=0.13.1. However, it is recommended to use v0.16 or newer versions of Pandas since this method @@ -530,7 +530,7 @@ class Filter(object): ---------- data_size : Integral The total number of bins in the tally corresponding to this filter - summary : None or Summary + summary : None or openmc.Summary An optional Summary object to be used to construct columns for distribcell tally filters (default is None). The geometric information in the Summary object is embedded into a Multi-index diff --git a/openmc/geometry.py b/openmc/geometry.py index be3f281eb..f5dfe97e4 100644 --- a/openmc/geometry.py +++ b/openmc/geometry.py @@ -17,7 +17,7 @@ class Geometry(object): Attributes ---------- - root_universe : openmc.universe.Universe + root_universe : openmc.Universe Root universe which contains all others """ @@ -95,7 +95,7 @@ class Geometry(object): Returns ------- - list of openmc.universe.Cell + list of openmc.Cell Cells in the geometry """ @@ -116,7 +116,7 @@ class Geometry(object): Returns ------- - list of openmc.universe.Universe + list of openmc.Universe Universes in the geometry """ @@ -136,7 +136,7 @@ class Geometry(object): Returns ------- - list of openmc.nuclide.Nuclide + list of openmc.Nuclide Nuclides in the geometry """ @@ -154,7 +154,7 @@ class Geometry(object): Returns ------- - list of openmc.material.Material + list of openmc.Material Materials in the geometry """ @@ -177,7 +177,7 @@ class Geometry(object): Returns ------- - list of openmc.universe.Cell + list of openmc.Cell Cells filled by Materials in the geometry """ @@ -198,7 +198,7 @@ class Geometry(object): Returns ------- - list of openmc.universe.Universe + list of openmc.Universe Universes with non-fill cells """ @@ -221,7 +221,7 @@ class Geometry(object): Returns ------- - list of openmc.universe.Lattice + list of openmc.Lattice Lattices in the geometry """ @@ -252,7 +252,7 @@ class Geometry(object): Returns ------- - list of openmc.material.Material + list of openmc.Material Materials matching the queried name """ @@ -292,7 +292,7 @@ class Geometry(object): Returns ------- - list of openmc.universe.Cell + list of openmc.Cell Cells matching the queried name """ @@ -332,7 +332,7 @@ class Geometry(object): Returns ------- - list of openmc.universe.Cell + list of openmc.Cell Cells with fills matching the queried name """ @@ -372,7 +372,7 @@ class Geometry(object): Returns ------- - list of openmc.universe.Universe + list of openmc.Universe Universes matching the queried name """ @@ -412,7 +412,7 @@ class Geometry(object): Returns ------- - list of openmc.universe.Lattice + list of openmc.Lattice Lattices matching the queried name """ @@ -444,7 +444,7 @@ class GeometryFile(object): Attributes ---------- - geometry : Geometry + geometry : openmc.Geometry The geometry to be used """ diff --git a/openmc/lattice.py b/openmc/lattice.py index 047bd5830..6417eef3c 100644 --- a/openmc/lattice.py +++ b/openmc/lattice.py @@ -33,7 +33,7 @@ class Lattice(object): outer : int The unique identifier of a universe to fill all space outside the lattice - universes : ndarray of Universe + universes : numpy.ndarray of openmc.Universe An array of universes filling each element of the lattice """ @@ -123,7 +123,7 @@ class Lattice(object): Returns ------- - universes : dict + universes : collections.OrderedDict Dictionary whose keys are universe IDs and values are Universe instances @@ -151,7 +151,7 @@ class Lattice(object): Returns ------- - nuclides : dict + nuclides : collections.OrderedDict Dictionary whose keys are nuclide names and values are 2-tuples of (nuclide, density) @@ -173,7 +173,7 @@ class Lattice(object): Returns ------- - cells : dict + cells : collections.OrderedDict Dictionary whose keys are cell IDs and values are Cell instances """ @@ -191,7 +191,7 @@ class Lattice(object): Returns ------- - materials : dict + materials : collections.OrderedDict Dictionary whose keys are material IDs and values are Material instances """ @@ -210,7 +210,7 @@ class Lattice(object): Returns ------- - universes : dict + universes : collections.OrderedDict Dictionary whose keys are universe IDs and values are Universe instances diff --git a/openmc/material.py b/openmc/material.py index 9db2f03f0..2c04a9ecf 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -270,7 +270,7 @@ class Material(object): Parameters ---------- - nuclide : str or openmc.nuclide.Nuclide + nuclide : str or openmc.Nuclide Nuclide to add percent : float Atom or weight percent @@ -313,7 +313,7 @@ class Material(object): Parameters ---------- - nuclide : openmc.nuclide.Nuclide + nuclide : openmc.Nuclide Nuclide to remove """ @@ -332,7 +332,7 @@ class Material(object): Parameters ---------- - macroscopic : str or Macroscopic + macroscopic : str or openmc.Macroscopic Macroscopic to add """ @@ -371,7 +371,7 @@ class Material(object): Parameters ---------- - macroscopic : Macroscopic + macroscopic : openmc.Macroscopic Macroscopic to remove """ @@ -390,7 +390,7 @@ class Material(object): Parameters ---------- - element : openmc.element.Element + element : openmc.Element Element to add percent : float Atom or weight percent @@ -429,7 +429,7 @@ class Material(object): Parameters ---------- - element : openmc.element.Element + element : openmc.Element Element to remove """ @@ -671,7 +671,7 @@ class MaterialsFile(object): Parameters ---------- - material : Material + material : openmc.Material Material to add """ @@ -688,7 +688,7 @@ class MaterialsFile(object): Parameters ---------- - materials : tuple or list of Material + materials : tuple or list of openmc.Material Materials to add """ @@ -706,7 +706,7 @@ class MaterialsFile(object): Parameters ---------- - material : Material + material : openmc.Material Material to remove """ diff --git a/openmc/mgxs/groups.py b/openmc/mgxs/groups.py index a1e03c337..068977d88 100644 --- a/openmc/mgxs/groups.py +++ b/openmc/mgxs/groups.py @@ -24,7 +24,7 @@ class EnergyGroups(object): ---------- group_edges : Iterable of Real The energy group boundaries [MeV] - num_groups : Integral + num_groups : int The number of energy groups """ @@ -86,7 +86,7 @@ class EnergyGroups(object): Parameters ---------- - energy : Real + energy : float The energy of interest in MeV Returns @@ -115,7 +115,7 @@ class EnergyGroups(object): Parameters ---------- - group : Integral + group : int The energy group index, starting at 1 for the highest energies Returns @@ -153,7 +153,7 @@ class EnergyGroups(object): Returns ------- - ndarray + numpy.ndarray The ndarray array indices for each energy group of interest Raises @@ -200,7 +200,7 @@ class EnergyGroups(object): Returns ------- - EnergyGroups + openmc.mgxs.EnergyGroups A coarsened version of this EnergyGroups object. Raises @@ -244,7 +244,7 @@ class EnergyGroups(object): Parameters ---------- - other : EnergyGroups + other : openmc.mgxs.EnergyGroups EnergyGroups to compare with Returns @@ -275,12 +275,12 @@ class EnergyGroups(object): Parameters ---------- - other : EnergyGroups + other : openmc.mgxs.EnergyGroups EnergyGroups to merge with Returns ------- - merged_groups : EnergyGroups + merged_groups : openmc.mgxs.EnergyGroups EnergyGroups resulting from the merge """ diff --git a/openmc/mgxs/library.py b/openmc/mgxs/library.py index c36d8d516..4de4bb48a 100644 --- a/openmc/mgxs/library.py +++ b/openmc/mgxs/library.py @@ -53,22 +53,22 @@ class Library(object): The types of cross sections in the library (e.g., ['total', 'scatter']) domain_type : {'material', 'cell', 'distribcell', 'universe'} Domain type for spatial homogenization - domains : Iterable of Material, Cell or Universe + domains : Iterable of openmc.Material, openmc.Cell or openmc.Universe The spatial domain(s) for which MGXS in the Library are computed - correction : 'P0' or None + correction : {'P0', None} Apply the P0 correction to scattering matrices if set to 'P0' - energy_groups : EnergyGroups + energy_groups : openmc.mgxs.EnergyGroups Energy group structure for energy condensation - tally_trigger : Trigger + tally_trigger : openmc.Trigger An (optional) tally precision trigger given to each tally used to compute the cross section - all_mgxs : OrderedDict + all_mgxs : collections.OrderedDict MGXS objects keyed by domain ID and cross section type sp_filename : str The filename of the statepoint with tally data used to the compute cross sections keff : Real or None - The combined keff from the statepoint file with tally data used to + The combined keff from the statepoint file with tally data used to compute cross sections (for eigenvalue calculations only) name : str, optional Name of the multi-group cross section library. Used as a label to @@ -308,7 +308,7 @@ class Library(object): """ cv.check_type('sparse', sparse, bool) - + # Sparsify or densify each MGXS in the Library for domain in self.domains: for mgxs_type in self.mgxs_types: @@ -350,7 +350,7 @@ class Library(object): def add_to_tallies_file(self, tallies_file, merge=True): """Add all tallies from all MGXS objects to a tallies file. - NOTE: This assumes that build_library() has been called + NOTE: This assumes that :meth:`Library.build_library` has been called Parameters ---------- @@ -537,7 +537,7 @@ class Library(object): Returns ------- - Library + openmc.mgxs.Library A new multi-group cross section library averaged across subdomains Raises diff --git a/openmc/mgxs/mgxs.py b/openmc/mgxs/mgxs.py index 7fcc0600a..a9a58b957 100644 --- a/openmc/mgxs/mgxs.py +++ b/openmc/mgxs/mgxs.py @@ -59,11 +59,11 @@ class MGXS(object): Parameters ---------- - domain : Material or Cell or Universe + domain : openmc.Material or openmc.Cell or openmc.Universe The domain for spatial homogenization domain_type : {'material', 'cell', 'distribcell', 'universe'} The domain type for spatial homogenization - energy_groups : EnergyGroups + energy_groups : openmc.mgxs.EnergyGroups The energy group structure for energy condensation by_nuclide : bool If true, computes cross sections for each nuclide in domain @@ -83,26 +83,26 @@ class MGXS(object): Domain for spatial homogenization domain_type : {'material', 'cell', 'distribcell', 'universe'} Domain type for spatial homogenization - energy_groups : EnergyGroups + energy_groups : openmc.mgxs.EnergyGroups Energy group structure for energy condensation - tally_trigger : Trigger + tally_trigger : openmc.Trigger An (optional) tally precision trigger given to each tally used to compute the cross section - tallies : OrderedDict + tallies : collections.OrderedDict OpenMC tallies needed to compute the multi-group cross section - rxn_rate_tally : Tally + rxn_rate_tally : openmc.Tally Derived tally for the reaction rate tally used in the numerator to compute the multi-group cross section. This attribute is None unless the multi-group cross section has been computed. - xs_tally : Tally + xs_tally : openmc.Tally Derived tally for the multi-group cross section. This attribute is None unless the multi-group cross section has been computed. - num_subdomains : Integral + num_subdomains : int The number of subdomains is unity for 'material', 'cell' and 'universe' domain types. When the This is equal to the number of cell instances for 'distribcell' domain types (it is equal to unity prior to loading tally data from a statepoint file). - num_nuclides : Integral + num_nuclides : int 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 : Iterable of str or 'sum' @@ -334,11 +334,11 @@ class MGXS(object): ---------- mgxs_type : {'total', 'transport', 'absorption', 'capture', 'fission', 'nu-fission', 'kappa-fission', 'scatter', 'nu-scatter', 'scatter matrix', 'nu-scatter matrix', 'chi'} The type of multi-group cross section object to return - domain : Material or Cell or Universe + domain : openmc.Material or openmc.Cell or openmc.Universe The domain for spatial homogenization domain_type : {'material', 'cell', 'distribcell', 'universe'} The domain type for spatial homogenization - energy_groups : EnergyGroups + energy_groups : openmc.mgxs.EnergyGroups The energy group structure for energy condensation by_nuclide : bool If true, computes cross sections for each nuclide in domain. @@ -349,7 +349,7 @@ class MGXS(object): Returns ------- - MGXS + openmc.mgxs.MGXS A subclass of the abstract MGXS class for the multi-group cross section type requested by the user @@ -425,7 +425,7 @@ class MGXS(object): Returns ------- - Real + float The atomic number density (atom/b-cm) for the nuclide of interest Raises @@ -464,7 +464,7 @@ class MGXS(object): Returns ------- - ndarray of Real + numpy.ndarray of float An array of the atomic number densities (atom/b-cm) for each of the nuclides in the spatial domain @@ -512,11 +512,11 @@ class MGXS(object): ---------- scores : Iterable of str Scores for each tally - all_filters : Iterable of tuple of Filter + all_filters : Iterable of tuple of openmc.Filter Tuples of non-spatial domain filters for each tally keys : Iterable of str Key string used to store each tally in the tallies dictionary - estimator : {'analog' or 'tracklength'} + estimator : {'analog', 'tracklength'} Type of estimator to use for each tally """ @@ -684,7 +684,7 @@ class MGXS(object): Returns ------- - ndarray + numpy.ndarray A NumPy array of the multi-group cross section indexed in the order each group, subdomain and nuclide is listed in the parameters. @@ -855,7 +855,7 @@ class MGXS(object): Returns ------- - MGXS + openmc.mgxs.MGXS A new MGXS averaged across the subdomains of interest Raises @@ -907,13 +907,13 @@ class MGXS(object): nuclides : list of str A list of nuclide name strings (e.g., ['U-235', 'U-238']; default is []) - groups : list of Integral + groups : list of int A list of energy group indices starting at 1 for the high energies (e.g., [1, 2, 3]; default is []) Returns ------- - MGXS + openmc.mgxs.MGXS A new tally which encapsulates the subset of data requested for the nuclide(s) and/or energy group(s) requested in the parameters. @@ -973,7 +973,7 @@ class MGXS(object): Parameters ---------- - other : MGXS + other : openmc.mgxs.MGXS MGXS to check for merging """ @@ -1010,12 +1010,12 @@ class MGXS(object): Parameters ---------- - other : MGXS + other : openmc.mgxs.MGXS MGXS to merge with this one Returns ------- - merged_mgxs : MGXS + merged_mgxs : openmc.mgxs.MGXS Merged MGXS """ @@ -1349,7 +1349,7 @@ class MGXS(object): xs_type='macro', summary=None): """Build a Pandas DataFrame for the MGXS data. - This method leverages the Tally.get_pandas_dataframe(...) method, but + This method leverages :math:`openmc.Tally.get_pandas_dataframe`, but renames the columns with terminology appropriate for cross section data. Parameters @@ -1366,7 +1366,7 @@ class MGXS(object): xs_type: {'macro', 'micro'} Return macro or micro cross section in units of cm^-1 or barns. Defaults to 'macro'. - summary : None or Summary + summary : None or openmc.Summary An optional Summary object to be used to construct columns for distribcell tally filters (default is None). The geometric information in the Summary object is embedded into a multi-index @@ -1933,16 +1933,16 @@ class ScatterMatrixXS(MGXS): nuclides : list of str A list of nuclide name strings (e.g., ['U-235', 'U-238']; default is []) - in_groups : list of Integral + in_groups : list of int A list of incoming energy group indices starting at 1 for the high energies (e.g., [1, 2, 3]; default is []) - out_groups : list of Integral + out_groups : list of int A list of outgoing energy group indices starting at 1 for the high energies (e.g., [1, 2, 3]; default is []) Returns ------- - MGXS + openmc.mgxs.MGXS A new tally which encapsulates the subset of data requested for the nuclide(s) and/or energy group(s) requested in the parameters. @@ -2379,12 +2379,12 @@ class Chi(MGXS): Parameters ---------- - other : MGXS + other : openmc.mgxs.MGXS MGXS to merge with this one Returns ------- - merged_mgxs : MGXS + merged_mgxs : openmc.mgxs.MGXS Merged MGXS """ @@ -2452,7 +2452,7 @@ class Chi(MGXS): Returns ------- - ndarray + numpy.ndarray A NumPy array of the multi-group cross section indexed in the order each group, subdomain and nuclide is listed in the parameters. @@ -2560,7 +2560,7 @@ class Chi(MGXS): xs_type='macro', summary=None): """Build a Pandas DataFrame for the MGXS data. - This method leverages the Tally.get_pandas_dataframe(...) method, but + This method leverages :math:`openmc.Tally.get_pandas_dataframe`, but renames the columns with terminology appropriate for cross section data. Parameters @@ -2577,7 +2577,7 @@ class Chi(MGXS): xs_type: {'macro', 'micro'} Return macro or micro cross section in units of cm^-1 or barns. Defaults to 'macro'. - summary : None or Summary + summary : None or openmc.Summary An optional Summary object to be used to construct columns for distribcell tally filters (default is None). The geometric information in the Summary object is embedded into a multi-index diff --git a/openmc/mgxs_library.py b/openmc/mgxs_library.py index 7f140dd21..c0b04fed1 100644 --- a/openmc/mgxs_library.py +++ b/openmc/mgxs_library.py @@ -24,7 +24,7 @@ def ndarray_to_string(arr): Parameters ---------- - arr : ndarray + arr : numpy.ndarray Array to combine in to a string Returns @@ -657,7 +657,7 @@ class MGXSLibraryFile(object): Energy group structure. inverse_velocities : Iterable of Real Inverse of velocities, units of sec/cm - xsdatas : Iterable of XSdata + xsdatas : Iterable of openmc.XSdata Iterable of multi-Group cross section data objects """ @@ -693,7 +693,7 @@ class MGXSLibraryFile(object): Parameters ---------- - xsdata : XSdata + xsdata : openmc.XSdata MGXS information to add """ @@ -716,7 +716,7 @@ class MGXSLibraryFile(object): Parameters ---------- - xsdatas : tuple or list of XSdata + xsdatas : tuple or list of openmc.XSdata XSdatas to add """ @@ -734,7 +734,7 @@ class MGXSLibraryFile(object): Parameters ---------- - xsdata : XSdata + xsdata : openmc.XSdata XSdata to remove """ diff --git a/openmc/plots.py b/openmc/plots.py index 636ca225c..6e78995f4 100644 --- a/openmc/plots.py +++ b/openmc/plots.py @@ -275,7 +275,7 @@ class Plot(object): The random number seed used to generate the color scheme """ - + cv.check_type('geometry', geometry, openmc.Geometry) cv.check_type('seed', seed, Integral) cv.check_greater_than('seed', seed, 1, equality=True) @@ -417,7 +417,7 @@ class PlotsFile(object): Parameters ---------- - plot : Plot + plot : openmc.Plot Plot to add """ @@ -433,7 +433,7 @@ class PlotsFile(object): Parameters ---------- - plot : Plot + plot : openmc.Plot Plot to remove """ diff --git a/openmc/region.py b/openmc/region.py index 7589184aa..a2edbeedd 100644 --- a/openmc/region.py +++ b/openmc/region.py @@ -9,10 +9,11 @@ from openmc.checkvalue import check_type class Region(object): """Region of space that can be assigned to a cell. - Region is an abstract base class that is inherited by Halfspace, - Intersection, Union, and Complement. Each of those respective classes are - typically not instantiated directly but rather are created through operators - of the Surface and Region classes. + Region is an abstract base class that is inherited by + :class:`openmc.Halfspace`, :class:`openmc.Intersection`, + :class:`openmc.Union`, and :class:`openmc.Complement`. Each of those + respective classes are typically not instantiated directly but rather are + created through operators of the Surface and Region classes. """ @@ -201,11 +202,11 @@ class Intersection(Region): """Intersection of two or more regions. Instances of Intersection are generally created via the __and__ operator - applied to two instances of Region. This is illustrated in the following - example: + applied to two instances of :class:`openmc.Region`. This is illustrated in + the following example: - >>> equator = openmc.surface.ZPlane(z0=0.0) - >>> earth = openmc.surface.Sphere(R=637.1e6) + >>> equator = openmc.ZPlane(z0=0.0) + >>> earth = openmc.Sphere(R=637.1e6) >>> northern_hemisphere = -earth & +equator >>> southern_hemisphere = -earth & -equator >>> type(northern_hemisphere) @@ -213,12 +214,12 @@ class Intersection(Region): Parameters ---------- - *nodes + \*nodes Regions to take the intersection of Attributes ---------- - nodes : tuple of Region + nodes : tuple of openmc.Region Regions to take the intersection of bounding_box : tuple of numpy.array Lower-left and upper-right coordinates of an axis-aligned bounding box @@ -255,21 +256,22 @@ class Union(Region): """Union of two or more regions. Instances of Union are generally created via the __or__ operator applied to - two instances of Region. This is illustrated in the following example: + two instances of :class:`openmc.Region`. This is illustrated in the + following example: - >>> s1 = openmc.surface.ZPlane(z0=0.0) - >>> s2 = openmc.surface.Sphere(R=637.1e6) + >>> s1 = openmc.ZPlane(z0=0.0) + >>> s2 = openmc.Sphere(R=637.1e6) >>> type(-s2 | +s1) Parameters ---------- - *nodes + \*nodes Regions to take the union of Attributes ---------- - nodes : tuple of Region + nodes : tuple of openmc.Region Regions to take the union of bounding_box : tuple of numpy.array Lower-left and upper-right coordinates of an axis-aligned bounding box @@ -305,13 +307,13 @@ class Union(Region): class Complement(Region): """Complement of a region. - The Complement of an existing Region can be created by using the __invert__ - operator as the following example demonstrates: + The Complement of an existing :class:`openmc.Region` can be created by using + the __invert__ operator as the following example demonstrates: - >>> xl = openmc.surface.XPlane(x0=-10.0) - >>> xr = openmc.surface.XPlane(x0=10.0) - >>> yl = openmc.surface.YPlane(y0=-10.0) - >>> yr = openmc.surface.YPlane(y0=10.0) + >>> xl = openmc.XPlane(x0=-10.0) + >>> xr = openmc.XPlane(x0=10.0) + >>> yl = openmc.YPlane(y0=-10.0) + >>> yr = openmc.YPlane(y0=10.0) >>> inside_box = +xl & -xr & +yl & -yl >>> outside_box = ~inside_box >>> type(outside_box) @@ -319,12 +321,12 @@ class Complement(Region): Parameters ---------- - node : Region + node : openmc.Region Region to take the complement of Attributes ---------- - node : Region + node : openmc.Region Regions to take the complement of bounding_box : tuple of numpy.array Lower-left and upper-right coordinates of an axis-aligned bounding box diff --git a/openmc/settings.py b/openmc/settings.py index 271932b84..0be50bc56 100644 --- a/openmc/settings.py +++ b/openmc/settings.py @@ -38,7 +38,7 @@ class SettingsFile(object): type are 'variance', 'std_dev', and 'rel_err'. The threshold value should be a float indicating the variance, standard deviation, or relative error used. - source : Iterable of openmc.source.Source + source : Iterable of openmc.Source Distribution of source sites in space, angle, and energy output : dict Dictionary indicating what files to output. Valid keys are 'summary', @@ -1125,19 +1125,19 @@ class ResonanceScattering(object): Attributes ---------- - nuclide : openmc.nuclide.Nuclide + nuclide : openmc.Nuclide The nuclide affected by this resonance scattering treatment. - nuclide_0K : openmc.nuclide.Nuclide + nuclide_0K : openmc.Nuclide This should be the same isotope as the nuclide attribute above, but it should have an xs attribute that identifies 0 Kelvin data. method : str The method used to sample outgoing scattering energies. Valid options are 'ARES', 'CXS' (constant cross section), 'DBRC' (Doppler broadening rejection correction), and 'WCM' (weight correction method). - E_min : Real + E_min : float The minimum energy above which the specified method is applied. By default, CXS will be used below E_min. - E_max : Real + E_max : float The maximum energy below which the specified method is applied. By default, the asymptotic target-at-rest model is applied above E_max. diff --git a/openmc/statepoint.py b/openmc/statepoint.py index 693400ad6..7b75ac767 100644 --- a/openmc/statepoint.py +++ b/openmc/statepoint.py @@ -18,51 +18,51 @@ class StatePoint(object): ---------- cmfd_on : bool Indicate whether CMFD is active - cmfd_balance : ndarray + cmfd_balance : numpy.ndarray Residual neutron balance for each batch cmfd_dominance Dominance ratio for each batch - cmfd_entropy : ndarray + cmfd_entropy : numpy.ndarray Shannon entropy of CMFD fission source for each batch - cmfd_indices : ndarray + cmfd_indices : numpy.ndarray Number of CMFD mesh cells and energy groups. The first three indices correspond to the x-, y-, and z- spatial directions and the fourth index is the number of energy groups. - cmfd_srccmp : ndarray + cmfd_srccmp : numpy.ndarray Root-mean-square difference between OpenMC and CMFD fission source for each batch - cmfd_src : ndarray + cmfd_src : numpy.ndarray CMFD fission source distribution over all mesh cells and energy groups. - current_batch : Integral + current_batch : int Number of batches simulated date_and_time : str Date and time when simulation began - entropy : ndarray + entropy : numpy.ndarray Shannon entropy of fission source at each batch gen_per_batch : Integral Number of fission generations per batch - global_tallies : ndarray of compound datatype + global_tallies : numpy.ndarray of compound datatype Global tallies for k-effective estimates and leakage. The compound datatype has fields 'name', 'sum', 'sum_sq', 'mean', and 'std_dev'. k_combined : list Combined estimator for k-effective and its uncertainty - k_col_abs : Real + k_col_abs : float Cross-product of collision and absorption estimates of k-effective - k_col_tra : Real + k_col_tra : float Cross-product of collision and tracklength estimates of k-effective - k_abs_tra : Real + k_abs_tra : float Cross-product of absorption and tracklength estimates of k-effective - k_generation : ndarray + k_generation : numpy.ndarray Estimate of k-effective for each batch/generation meshes : dict Dictionary whose keys are mesh IDs and whose values are Mesh objects - n_batches : Integral + n_batches : int Number of batches - n_inactive : Integral + n_inactive : int Number of inactive batches - n_particles : Integral + n_particles : int Number of particles per generation - n_realizations : Integral + n_realizations : int Number of tally realizations path : str Working directory for simulation @@ -71,9 +71,9 @@ class StatePoint(object): runtime : dict Dictionary whose keys are strings describing various runtime metrics and whose values are time values in seconds. - seed : Integral + seed : int Pseudorandom number generator seed - source : ndarray of compound datatype + source : numpy.ndarray of compound datatype Array of source sites. The compound datatype has fields 'wgt', 'xyz', 'uvw', and 'E' corresponding to the weight, position, direction, and energy of the source site. @@ -88,7 +88,7 @@ class StatePoint(object): Indicate whether user-defined tallies are present version: tuple of Integral Version of OpenMC - summary : None or openmc.summary.Summary + summary : None or openmc.Summary A summary object if the statepoint has been linked with a summary file """ @@ -504,7 +504,7 @@ class StatePoint(object): Returns ------- - tally : Tally + tally : openmc.Tally A tally matching the specified criteria Raises @@ -601,7 +601,7 @@ class StatePoint(object): Parameters ---------- - summary : Summary + summary : openmc.Summary A Summary object. Raises diff --git a/openmc/stats/multivariate.py b/openmc/stats/multivariate.py index 29258ee8d..4ce34a071 100644 --- a/openmc/stats/multivariate.py +++ b/openmc/stats/multivariate.py @@ -22,12 +22,12 @@ class UnitSphere(object): Parameters ---------- - reference_uvw : Iterable of Real + reference_uvw : Iterable of float Direction from which polar angle is measured Attributes ---------- - reference_uvw : Iterable of Real + reference_uvw : Iterable of float Direction from which polar angle is measured """ @@ -62,19 +62,19 @@ class PolarAzimuthal(UnitSphere): Parameters ---------- - mu : Univariate + mu : openmc.stats.Univariate Distribution of the cosine of the polar angle - phi : Univariate + phi : openmc.stats.Univariate Distribution of the azimuthal angle in radians - reference_uvw : Iterable of Real + reference_uvw : Iterable of float Direction from which polar angle is measured. Defaults to the positive z-direction. Attributes ---------- - mu : Univariate + mu : openmc.stats.Univariate Distribution of the cosine of the polar angle - phi : Univariate + phi : openmc.stats.Univariate Distribution of the azimuthal angle in radians """ @@ -142,7 +142,7 @@ class Monodirectional(UnitSphere): Parameters ---------- - reference_uvw : Iterable of Real + reference_uvw : Iterable of float Direction from which polar angle is measured. Defaults to the positive x-direction. @@ -186,20 +186,20 @@ class CartesianIndependent(Spatial): Parameters ---------- - x : Univariate + x : openmc.stats.Univariate Distribution of x-coordinates - y : Univariate + y : openmc.stats.Univariate Distribution of y-coordinates - z : Univariate + z : openmc.stats.Univariate Distribution of z-coordinates Attributes ---------- - x : Univariate + x : openmc.stats.Univariate Distribution of x-coordinates - y : Univariate + y : openmc.stats.Univariate Distribution of y-coordinates - z : Univariate + z : openmc.stats.Univariate Distribution of z-coordinates """ @@ -252,9 +252,9 @@ class Box(Spatial): Parameters ---------- - lower_left : Iterable of Real + lower_left : Iterable of float Lower-left coordinates of cuboid - upper_right : Iterable of Real + upper_right : Iterable of float Upper-right coordinates of cuboid only_fissionable : bool, optional Whether spatial sites should only be accepted if they occur in @@ -262,9 +262,9 @@ class Box(Spatial): Attributes ---------- - lower_left : Iterable of Real + lower_left : Iterable of float Lower-left coordinates of cuboid - upper_right : Iterable of Real + upper_right : Iterable of float Upper-right coordinates of cuboid only_fissionable : bool, optional Whether spatial sites should only be accepted if they occur in @@ -328,12 +328,12 @@ class Point(Spatial): Parameters ---------- - xyz : Iterable of Real + xyz : Iterable of float Cartesian coordinates of location Attributes ---------- - xyz : Iterable of Real + xyz : Iterable of float Cartesian coordinates of location """ diff --git a/openmc/stats/univariate.py b/openmc/stats/univariate.py index 04e70bd00..0deeb600c 100644 --- a/openmc/stats/univariate.py +++ b/openmc/stats/univariate.py @@ -37,16 +37,16 @@ class Discrete(Univariate): Parameters ---------- - x : Iterable of Real + x : Iterable of float Values of the random variable - p : Iterable of Real + p : Iterable of float Discrete probability for each value Attributes ---------- - x : Iterable of Real + x : Iterable of float Values of the random variable - p : Iterable of Real + p : Iterable of float Discrete probability for each value """ @@ -243,9 +243,9 @@ class Tabular(Univariate): Parameters ---------- - x : Iterable of Real + x : Iterable of float Tabulated values of the random variable - p : Iterable of Real + p : Iterable of float Tabulated probabilities interpolation : {'histogram', 'linear-linear'}, optional Indicate whether the density function is constant between tabulated @@ -253,9 +253,9 @@ class Tabular(Univariate): Attributes ---------- - x : Iterable of Real + x : Iterable of float Tabulated values of the random variable - p : Iterable of Real + p : Iterable of float Tabulated probabilities interpolation : {'histogram', 'linear-linear'}, optional Indicate whether the density function is constant between tabulated diff --git a/openmc/summary.py b/openmc/summary.py index b8f92664f..9b1c451f3 100644 --- a/openmc/summary.py +++ b/openmc/summary.py @@ -584,7 +584,7 @@ class Summary(object): Returns ------- - material : openmc.material.Material + material : openmc.Material Material with given id """ @@ -605,7 +605,7 @@ class Summary(object): Returns ------- - surface : openmc.surface.Surface + surface : openmc.Surface Surface with given id """ @@ -626,7 +626,7 @@ class Summary(object): Returns ------- - cell : openmc.universe.Cell + cell : openmc.Cell Cell with given id """ @@ -647,7 +647,7 @@ class Summary(object): Returns ------- - universe : openmc.universe.Universe + universe : openmc.Universe Universe with given id """ @@ -668,7 +668,7 @@ class Summary(object): Returns ------- - lattice : openmc.universe.Lattice + lattice : openmc.Lattice Lattice with given id """ diff --git a/openmc/surface.py b/openmc/surface.py index 8dc45209b..5b0b1a7b5 100644 --- a/openmc/surface.py +++ b/openmc/surface.py @@ -153,10 +153,10 @@ class Surface(object): Returns ------- - numpy.array + numpy.ndarray Lower-left coordinates of the axis-aligned bounding box for the desired half-space - numpy.array + numpy.ndarray Upper-right coordinates of the axis-aligned bounding box for the desired half-space @@ -338,10 +338,10 @@ class XPlane(Plane): Returns ------- - numpy.array + numpy.ndarray Lower-left coordinates of the axis-aligned bounding box for the desired half-space - numpy.array + numpy.ndarray Upper-right coordinates of the axis-aligned bounding box for the desired half-space @@ -416,10 +416,10 @@ class YPlane(Plane): Returns ------- - numpy.array + numpy.ndarray Lower-left coordinates of the axis-aligned bounding box for the desired half-space - numpy.array + numpy.ndarray Upper-right coordinates of the axis-aligned bounding box for the desired half-space @@ -494,10 +494,10 @@ class ZPlane(Plane): Returns ------- - numpy.array + numpy.ndarray Lower-left coordinates of the axis-aligned bounding box for the desired half-space - numpy.array + numpy.ndarray Upper-right coordinates of the axis-aligned bounding box for the desired half-space @@ -641,10 +641,10 @@ class XCylinder(Cylinder): Returns ------- - numpy.array + numpy.ndarray Lower-left coordinates of the axis-aligned bounding box for the desired half-space - numpy.array + numpy.ndarray Upper-right coordinates of the axis-aligned bounding box for the desired half-space @@ -740,10 +740,10 @@ class YCylinder(Cylinder): Returns ------- - numpy.array + numpy.ndarray Lower-left coordinates of the axis-aligned bounding box for the desired half-space - numpy.array + numpy.ndarray Upper-right coordinates of the axis-aligned bounding box for the desired half-space @@ -839,10 +839,10 @@ class ZCylinder(Cylinder): Returns ------- - numpy.array + numpy.ndarray Lower-left coordinates of the axis-aligned bounding box for the desired half-space - numpy.array + numpy.ndarray Upper-right coordinates of the axis-aligned bounding box for the desired half-space @@ -967,10 +967,10 @@ class Sphere(Surface): Returns ------- - numpy.array + numpy.ndarray Lower-left coordinates of the axis-aligned bounding box for the desired half-space - numpy.array + numpy.ndarray Upper-right coordinates of the axis-aligned bounding box for the desired half-space @@ -1383,7 +1383,7 @@ class Halfspace(Region): can be created from an existing Surface through the __neg__ and __pos__ operators, as the following example demonstrates: - >>> sphere = openmc.surface.Sphere(surface_id=1, R=10.0) + >>> sphere = openmc.Sphere(surface_id=1, R=10.0) >>> inside_sphere = -sphere >>> outside_sphere = +sphere >>> type(inside_sphere) @@ -1391,18 +1391,18 @@ class Halfspace(Region): Parameters ---------- - surface : Surface + surface : openmc.Surface Surface which divides Euclidean space. side : {'+', '-'} Indicates whether the positive or negative half-space is used. Attributes ---------- - surface : Surface + surface : openmc.Surface Surface which divides Euclidean space. side : {'+', '-'} Indicates whether the positive or negative half-space is used. - bounding_box : tuple of numpy.array + bounding_box : tuple of numpy.ndarray Lower-left and upper-right coordinates of an axis-aligned bounding box """ diff --git a/openmc/tallies.py b/openmc/tallies.py index 1e47811e3..2ee03c675 100644 --- a/openmc/tallies.py +++ b/openmc/tallies.py @@ -51,7 +51,7 @@ class Tally(object): Parameters ---------- - tally_id : Integral, optional + tally_id : int, optional Unique identifier for the tally. If none is specified, an identifier will automatically be assigned name : str, optional @@ -59,43 +59,43 @@ class Tally(object): Attributes ---------- - id : Integral + id : int Unique identifier for the tally name : str Name of the tally - filters : list of openmc.filter.Filter + filters : list of openmc.Filter List of specified filters for the tally - nuclides : list of openmc.nuclide.Nuclide + nuclides : list of openmc.Nuclide List of nuclides to score results for scores : list of str List of defined scores, e.g. 'flux', 'fission', etc. estimator : {'analog', 'tracklength', 'collision'} Type of estimator for the tally - triggers : list of openmc.trigger.Trigger + triggers : list of openmc.Trigger List of tally triggers - num_scores : Integral + num_scores : int Total number of scores, accounting for the fact that a single user-specified score, e.g. scatter-P3 or flux-Y2,2, might have multiple bins - num_filter_bins : Integral + num_filter_bins : int Total number of filter bins accounting for all filters - num_bins : Integral + num_bins : int Total number of bins for the tally - shape : 3-tuple of Integral + shape : 3-tuple of int The shape of the tally data array ordered as the number of filter bins, nuclide bins and score bins - num_realizations : Integral + num_realizations : int Total number of realizations with_summary : bool Whether or not a Summary has been linked - sum : ndarray + sum : numpy.ndarray An array containing the sum of each independent realization for each bin - sum_sq : ndarray + sum_sq : numpy.ndarray An array containing the sum of each independent realization squared for each bin - mean : ndarray + mean : numpy.ndarray An array containing the sample mean for each bin - std_dev : ndarray + std_dev : numpy.ndarray An array containing the sample standard deviation for each bin derived : bool Whether or not the tally is derived from one or more other tallies @@ -444,7 +444,7 @@ class Tally(object): Parameters ---------- - trigger : openmc.trigger.Trigger + trigger : openmc.Trigger Trigger to add """ @@ -688,7 +688,7 @@ class Tally(object): Parameters ---------- - old_filter : openmc.filter.Filter + old_filter : openmc.Filter Filter to remove """ @@ -705,7 +705,7 @@ class Tally(object): Parameters ---------- - nuclide : openmc.nuclide.Nuclide + nuclide : openmc.Nuclide Nuclide to remove """ @@ -727,7 +727,7 @@ class Tally(object): Parameters ---------- - other : Tally + other : openmc.Tally Tally to check for mergeable filters """ @@ -780,7 +780,7 @@ class Tally(object): Parameters ---------- - other : Tally + other : openmc.Tally Tally to check for mergeable nuclides """ @@ -817,7 +817,7 @@ class Tally(object): Parameters ---------- - other : Tally + other : openmc.Tally Tally to check for mergeable scores """ @@ -858,7 +858,7 @@ class Tally(object): Parameters ---------- - other : Tally + other : openmc.Tally Tally to check for merging """ @@ -903,12 +903,12 @@ class Tally(object): Parameters ---------- - other : Tally + other : openmc.Tally Tally to merge with this one Returns ------- - merged_tally : Tally + merged_tally : openmc.Tally Merged tallies """ @@ -1151,7 +1151,7 @@ class Tally(object): Returns ------- - filter_found : openmc.filter.Filter + filter_found : openmc.Filter Filter from this tally with matching type, or None if no matching Filter is found @@ -1185,7 +1185,7 @@ class Tally(object): ---------- filter_type : str The type of Filter (e.g., 'cell', 'energy', etc.) - filter_bin : Integral or tuple + filter_bin : int or tuple The bin is an integer ID for 'material', 'surface', 'cell', 'cellborn', and 'universe' Filters. The bin is an integer for the cell instance ID for 'distribcell' Filters. The bin is a 2-tuple of @@ -1311,7 +1311,7 @@ class Tally(object): Returns ------- - ndarray + numpy.ndarray A NumPy array of the filter indices """ @@ -1393,7 +1393,7 @@ class Tally(object): Returns ------- - ndarray + numpy.ndarray A NumPy array of the nuclide indices """ @@ -1427,7 +1427,7 @@ class Tally(object): Returns ------- - ndarray + numpy.ndarray A NumPy array of the score indices """ @@ -1489,7 +1489,7 @@ class Tally(object): Returns ------- - float or ndarray + float or numpy.ndarray A scalar or NumPy array of the Tally data indexed in the order each filter, nuclide and score is listed in the parameters. @@ -1557,13 +1557,13 @@ class Tally(object): Include columns with nuclide bin information (default is True). scores : bool Include columns with score bin information (default is True). - summary : None or Summary + summary : None or openmc.Summary An optional Summary object to be used to construct columns for distribcell tally filters (default is None). The geometric information in the Summary object is embedded into a Multi-index column with a geometric "path" to each distribcell intance. NOTE: This option requires the OpenCG Python package. - float_format : string + float_format : str All floats in the DataFrame will be formatted using the given format string before printing. @@ -1683,8 +1683,8 @@ class Tally(object): The tally data in OpenMC is stored as a 3D array with the dimensions corresponding to filters, nuclides and scores. As a result, tally data - can be opaque for a user to directly index (i.e., without use of the - Tally.get_values(...) method) since one must know how to properly use + can be opaque for a user to directly index (i.e., without use of + :meth:`openmc.Tally.get_values`) since one must know how to properly use the number of bins and strides for each filter to index into the first (filter) dimension. @@ -1704,7 +1704,7 @@ class Tally(object): Returns ------- - ndarray + numpy.ndarray The tally data array indexed by filters, nuclides and scores. """ @@ -1882,7 +1882,7 @@ class Tally(object): Parameters ---------- - other : Tally + other : openmc.Tally The tally on the right hand side of the hybrid product binary_op : {'+', '-', '*', '/', '^'} The binary operation in the hybrid product @@ -1904,7 +1904,7 @@ class Tally(object): Returns ------- - Tally + openmc.Tally A new Tally that is the hybrid product with this one. Raises @@ -2082,7 +2082,7 @@ class Tally(object): Parameters ---------- - other : Tally + other : openmc.Tally The tally to outer product with this tally filter_product : {'entrywise'} The type of product to be performed between filter data. Currently, @@ -2464,12 +2464,12 @@ class Tally(object): Parameters ---------- - other : Tally or Real + other : openmc.Tally or float The tally or scalar value to add to this tally Returns ------- - Tally + openmc.Tally A new derived tally which is the sum of this tally and the other tally or scalar value in the addition. @@ -2536,12 +2536,12 @@ class Tally(object): Parameters ---------- - other : Tally or Real + other : openmc.Tally or float The tally or scalar value to subtract from this tally Returns ------- - Tally + openmc.Tally A new derived tally which is the difference of this tally and the other tally or scalar value in the subtraction. @@ -2608,12 +2608,12 @@ class Tally(object): Parameters ---------- - other : Tally or Real + other : openmc.Tally or float The tally or scalar value to multiply with this tally Returns ------- - Tally + openmc.Tally A new derived tally which is the product of this tally and the other tally or scalar value in the multiplication. @@ -2680,12 +2680,12 @@ class Tally(object): Parameters ---------- - other : Tally or Real + other : openmc.Tally or float The tally or scalar value to divide this tally by Returns ------- - Tally + openmc.Tally A new derived tally which is the dividend of this tally and the other tally or scalar value in the division. @@ -2755,12 +2755,12 @@ class Tally(object): Parameters ---------- - power : Tally or Real + power : openmc.Tally or float The tally or scalar value exponent Returns ------- - Tally + openmc.Tally A new derived tally which is this tally raised to the power of the other tally or scalar value in the exponentiation. @@ -2816,12 +2816,12 @@ class Tally(object): Parameters ---------- - other : Integer or Real + other : float The scalar value to add to this tally Returns ------- - Tally + openmc.Tally A new derived tally of this tally added with the scalar value. """ @@ -2835,12 +2835,12 @@ class Tally(object): Parameters ---------- - other : Integer or Real + other : float The scalar value to subtract this tally from Returns ------- - Tally + openmc.Tally A new derived tally of this tally subtracted from the scalar value. """ @@ -2854,12 +2854,12 @@ class Tally(object): Parameters ---------- - other : Integer or Real + other : float The scalar value to multiply with this tally Returns ------- - Tally + openmc.Tally A new derived tally of this tally multiplied by the scalar value. """ @@ -2873,12 +2873,12 @@ class Tally(object): Parameters ---------- - other : Integer or Real + other : float The scalar value to divide by this tally Returns ------- - Tally + openmc.Tally A new derived tally of the scalar value divided by this tally. """ @@ -2890,7 +2890,7 @@ class Tally(object): Returns ------- - Tally + openmc.Tally A new derived tally which is the absolute value of this tally. """ @@ -2904,7 +2904,7 @@ class Tally(object): Returns ------- - Tally + openmc.Tally A new derived tally which is the negated value of this tally. """ @@ -2946,7 +2946,7 @@ class Tally(object): Returns ------- - Tally + openmc.Tally A new tally which encapsulates the subset of data requested in the order each filter, nuclide and score is listed in the parameters. @@ -3069,7 +3069,7 @@ class Tally(object): filter_type : str A filter type string (e.g., 'cell', 'energy') corresponding to the filter bins to sum across - filter_bins : Iterable of Integral or tuple + filter_bins : Iterable of int or tuple A list of the filter bins corresponding to the filter_type parameter Each bin in the list is the integer ID for 'material', 'surface', 'cell', 'cellborn', and 'universe' Filters. Each bin is an integer @@ -3087,7 +3087,7 @@ class Tally(object): Returns ------- - Tally + openmc.Tally A new tally which encapsulates the sum of data requested. """ @@ -3217,7 +3217,7 @@ class Tally(object): filter_type : str A filter type string (e.g., 'cell', 'energy') corresponding to the filter bins to average across - filter_bins : Iterable of Integral or tuple + filter_bins : Iterable of int or tuple A list of the filter bins corresponding to the filter_type parameter Each bin in the list is the integer ID for 'material', 'surface', 'cell', 'cellborn', and 'universe' Filters. Each bin is an integer @@ -3235,7 +3235,7 @@ class Tally(object): Returns ------- - Tally + openmc.Tally A new tally which encapsulates the average of data requested. """ @@ -3368,7 +3368,7 @@ class Tally(object): Returns ------- - Tally + openmc.Tally A new derived Tally with data diagaonalized along the new filter. """ @@ -3444,9 +3444,8 @@ class TalliesFile(object): Parameters ---------- - tally : Tally + tally : openmc.Tally Tally to add to file - merge : bool Indicate whether the tally should be merged with an existing tally, if possible. Defaults to False. @@ -3483,7 +3482,7 @@ class TalliesFile(object): Parameters ---------- - tally : Tally + tally : openmc.Tally Tally to remove """ @@ -3519,7 +3518,7 @@ class TalliesFile(object): Parameters ---------- - mesh : openmc.mesh.Mesh + mesh : openmc.Mesh Mesh to add to the file """ @@ -3535,7 +3534,7 @@ class TalliesFile(object): Parameters ---------- - mesh : openmc.mesh.Mesh + mesh : openmc.Mesh Mesh to remove from the file """ diff --git a/openmc/universe.py b/openmc/universe.py index 09f547042..ebc2eced4 100644 --- a/openmc/universe.py +++ b/openmc/universe.py @@ -43,7 +43,7 @@ class Universe(object): Unique identifier of the universe name : str Name of the universe - cells : dict + cells : collections.OrderedDict Dictionary whose keys are cell IDs and values are Cell instances """ @@ -126,7 +126,7 @@ class Universe(object): Parameters ---------- - cell : Cell + cell : openmc.Cell Cell to add """ @@ -146,7 +146,7 @@ class Universe(object): Parameters ---------- - cells : array-like of Cell + cells : Iterable of openmc.Cell Cells to add """ @@ -164,7 +164,7 @@ class Universe(object): Parameters ---------- - cell : Cell + cell : openmc.Cell Cell to remove """ @@ -209,7 +209,7 @@ class Universe(object): Returns ------- - nuclides : dict + nuclides : collections.OrderedDict Dictionary whose keys are nuclide names and values are 2-tuples of (nuclide, density) @@ -228,7 +228,7 @@ class Universe(object): Returns ------- - cells : dict + cells : collections.OrderedDict Dictionary whose keys are cell IDs and values are Cell instances """ @@ -249,7 +249,7 @@ class Universe(object): Returns ------- - materials : dict + materials : Collections.OrderedDict Dictionary whose keys are material IDs and values are Material instances """ @@ -268,7 +268,7 @@ class Universe(object): Returns ------- - universes : dict + universes : collections.OrderedDict Dictionary whose keys are universe IDs and values are Universe instances