Skip to content

Commit

Permalink
Merge pull request #946 from paulromano/eq-hash
Browse files Browse the repository at this point in the history
Ensure mutable objects are not hashable
  • Loading branch information
smharper committed Dec 20, 2017
2 parents c2e1adf + 55f7260 commit a149ef4
Show file tree
Hide file tree
Showing 36 changed files with 1,961 additions and 2,835 deletions.
4 changes: 2 additions & 2 deletions docs/source/conf.py
Expand Up @@ -27,8 +27,8 @@
MOCK_MODULES = ['numpy', 'numpy.polynomial', 'numpy.polynomial.polynomial',
'numpy.ctypeslib', 'scipy', 'scipy.sparse', 'scipy.interpolate',
'scipy.integrate', 'scipy.optimize', 'scipy.special',
'scipy.stats','h5py', 'pandas', 'uncertainties', 'openmoc',
'openmc.data.reconstruct']
'scipy.stats', 'h5py', 'pandas', 'uncertainties',
'matplotlib.pyplot','openmoc', 'openmc.data.reconstruct']
sys.modules.update((mod_name, MagicMock()) for mod_name in MOCK_MODULES)

import numpy as np
Expand Down
23 changes: 11 additions & 12 deletions docs/source/io_formats/materials.rst
Expand Up @@ -92,20 +92,8 @@ Each ``material`` element can have the following attributes or sub-elements:
.. note:: If one nuclide is specified in atom percent, all others must also
be given in atom percent. The same applies for weight percentages.

An optional attribute/sub-element for each nuclide is ``scattering``. This
attribute may be set to "data" to use the scattering laws specified by the
cross section library (default). Alternatively, when set to "iso-in-lab",
the scattering laws are used to sample the outgoing energy but an
isotropic-in-lab distribution is used to sample the outgoing angle at each
scattering interaction. The ``scattering`` attribute may be most useful
when using OpenMC to compute multi-group cross-sections for deterministic
transport codes and to quantify the effects of anisotropic scattering.

*Default*: None

.. note:: The ``scattering`` attribute/sub-element is not used in the
multi-group :ref:`energy_mode`.

:sab:
Associates an S(a,b) table with the material. This element has an
attribute/sub-element called ``name``. The ``name`` attribute
Expand All @@ -119,6 +107,17 @@ Each ``material`` element can have the following attributes or sub-elements:

.. note:: This element is not used in the multi-group :ref:`energy_mode`.

:isotropic:
The ``isotropic`` element indicates a list of nuclides for which elastic
scattering should be treated as though it were isotropic in the laboratory
system. This element may be most useful when using OpenMC to compute
multi-group cross-sections for deterministic transport codes and to quantify
the effects of anisotropic scattering.

*Default*: No nuclides are treated as have isotropic elastic scattering.

.. note:: This element is not used in the multi-group :ref:`energy_mode`.

:macroscopic:
The ``macroscopic`` element is similar to the ``nuclide`` element, but,
recognizes that some multi-group libraries may be providing material
Expand Down
6 changes: 2 additions & 4 deletions examples/jupyter/mg-mode-part-i.ipynb
Expand Up @@ -148,11 +148,9 @@
"source": [
"To build the actual 2-D model, we will first begin by creating the `materials.xml` file.\n",
"\n",
"First we need to define materials that will be used in the problem. In other notebooks, either `openmc.Nuclide`s or `openmc.Element`s were created at the equivalent stage. We can do that in multi-group mode as well. However, multi-group cross-sections are sometimes provided as macroscopic cross-sections; the C5G7 benchmark data are macroscopic. In this case, we can instead use `openmc.Macroscopic` objects to in-place of `openmc.Nuclide` or `openmc.Element` objects.\n",
"First we need to define materials that will be used in the problem. In other notebooks, either nuclides or elements were added to materials at the equivalent stage. We can do that in multi-group mode as well. However, multi-group cross-sections are sometimes provided as macroscopic cross-sections; the C5G7 benchmark data are macroscopic. In this case, we can instead use the `Material.add_macroscopic` method to specific a macroscopic object. Unlike for nuclides and elements, we do not need provide information on atom/weight percents as no number densities are needed.\n",
"\n",
"`openmc.Macroscopic`, unlike `openmc.Nuclide` and `openmc.Element` objects, do not need to be provided enough information to calculate number densities, as no number densities are needed.\n",
"\n",
"When assigning `openmc.Macroscopic` objects to `openmc.Material` objects, the density can still be scaled by setting the density to a value that is not 1.0. This would be useful, for example, when slightly perturbing the density of water due to a small change in temperature (while of course ignoring any resultant spectral shift). The density of a macroscopic dataset is set to 1.0 in the `openmc.Material` object by default when an `openmc.Macroscopic` dataset is used; so we will show its use the first time and then afterwards it will not be required.\n",
"When assigning macroscopic objects to a material, the density can still be scaled by setting the density to a value that is not 1.0. This would be useful, for example, when slightly perturbing the density of water due to a small change in temperature (while of course ignoring any resultant spectral shift). The density of a macroscopic dataset is set to 1.0 in the `openmc.Material` object by default when a macroscopic dataset is used; so we will show its use the first time and then afterwards it will not be required.\n",
"\n",
"Aside from these differences, the following code is very similar to similar code in other OpenMC example Notebooks."
]
Expand Down
117 changes: 71 additions & 46 deletions examples/jupyter/mg-mode-part-iii.ipynb

Large diffs are not rendered by default.

0 comments on commit a149ef4

Please sign in to comment.