Skip to content

Commit

Permalink
Merge 1e6027a into c374838
Browse files Browse the repository at this point in the history
  • Loading branch information
john-science committed Jan 29, 2024
2 parents c374838 + 1e6027a commit 030e934
Show file tree
Hide file tree
Showing 15 changed files with 47 additions and 49 deletions.
15 changes: 8 additions & 7 deletions armi/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@
Framework for a specific application. An ``App`` implements a simple interface for
customizing much of the Framework's behavior.
.. admonition:: Historical Fun Fact
This pattern is used by many frameworks as a way of encapsulating what would
otherwise be global state. The ARMI Framework has historically made heavy use of
global state (e.g., :py:mod:`armi.nucDirectory.nuclideBases`), and it will take
quite a bit of effort to refactor the code to access such things through an App
object.
Notes
-----
Historical Fun Fact
This pattern is used by many frameworks as a way of encapsulating what would otherwise be global
state. The ARMI Framework has historically made heavy use of global state (e.g.,
:py:mod:`armi.nucDirectory.nuclideBases`), and it will take quite a bit of effort to refactor the
code to access such things through an App object.
"""
# ruff: noqa: E402
from typing import Dict, Optional, Tuple, List
Expand Down
4 changes: 1 addition & 3 deletions armi/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
See Also
--------
armi.operators : Schedule calls to various interfaces
armi.plugins : Register various interfaces
"""
import copy
from typing import Union
Expand Down Expand Up @@ -362,7 +360,7 @@ def preDistributeState(self):
Examples
--------
return {'neutronsPerFission',self.neutronsPerFission}
>>> return {'neutronsPerFission',self.neutronsPerFission}
"""
return {}

Expand Down
1 change: 0 additions & 1 deletion armi/nuclearDataIO/cccc/compxs.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
Examples
--------
::
>>> from armi.nuclearDataIO import compxs
>>> lib = compxs.readBinary('COMPXS')
>>> r0 = lib.regions[0]
Expand Down
2 changes: 1 addition & 1 deletion armi/nuclearDataIO/cccc/nhflux.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ def _rwGeodstCoordMap2D(self):
Examples
--------
geodstCoordMap[NodalIndex] = geodstIndex
geodstCoordMap[NodalIndex] = geodstIndex
See Also
--------
Expand Down
16 changes: 8 additions & 8 deletions armi/nuclearDataIO/xsCollections.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
Examples
--------
# creating a MicroscopicXSCollection by loading one from ISOTXS.
microLib = armi.nuclearDataIO.ISOTXS('ISOTXS')
micros = myLib.nuclides['U235AA'].micros
# creating macroscopic XS:
mc = MacroscopicCrossSectionCreator()
macroCollection = mc.createMacrosFromMicros(microLib, block)
blocksWithMacros = mc.createMacrosOnBlocklist(microLib, blocks)
# creating a MicroscopicXSCollection by loading one from ISOTXS.
microLib = armi.nuclearDataIO.ISOTXS('ISOTXS')
micros = myLib.nuclides['U235AA'].micros
# creating macroscopic XS:
mc = MacroscopicCrossSectionCreator()
macroCollection = mc.createMacrosFromMicros(microLib, block)
blocksWithMacros = mc.createMacrosOnBlocklist(microLib, blocks)
"""
import numpy
Expand Down
8 changes: 4 additions & 4 deletions armi/nuclearDataIO/xsNuclides.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@

r"""
This module contains cross section nuclides, which are a wrapper around the
:py:class:`~armi.nucDirectory.nuclideBases.INuclide` objects. The cross section nuclide objects contain
cross section information from a specific calculation (e.g. neutron, or gamma cross sections).
:py:class:`~armi.nucDirectory.nuclideBases.INuclide` objects. The cross section nuclide objects
contain cross section information from a specific calculation (e.g. neutron, or gamma cross sections).
:py:class:`XSNuclide` objects also contain meta data from the original file, so that another file can be
reconstructed.
:py:class:`XSNuclide` objects also contain meta data from the original file, so that another file
can be reconstructed.
.. warning::
:py:class:`XSNuclide` objects should only be created by reading data into
Expand Down
4 changes: 2 additions & 2 deletions armi/physics/neutronics/crossSectionSettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ def getStr(cls, typeSpec: Enum):
Examples
--------
XSGeometryTypes.getStr(XSGeometryTypes.ZERO_DIMENSIONAL) == "0D"
XSGeometryTypes.getStr(XSGeometryTypes.TWO_DIMENSIONAL_HEX) == "2D hex"
XSGeometryTypes.getStr(XSGeometryTypes.ZERO_DIMENSIONAL) == "0D"
XSGeometryTypes.getStr(XSGeometryTypes.TWO_DIMENSIONAL_HEX) == "2D hex"
"""
geometryTypes = list(cls)
if typeSpec not in geometryTypes:
Expand Down
10 changes: 5 additions & 5 deletions armi/reactor/assemblies.py
Original file line number Diff line number Diff line change
Expand Up @@ -864,8 +864,8 @@ def getBlocksAndZ(self, typeSpec=None, returnBottomZ=False, returnTopZ=False):
Examples
--------
for block, bottomZ in a.getBlocksAndZ(returnBottomZ=True):
print({0}'s bottom mesh point is {1}'.format(block, bottomZ))
for block, bottomZ in a.getBlocksAndZ(returnBottomZ=True):
print({0}'s bottom mesh point is {1}'.format(block, bottomZ))
"""
if returnBottomZ and returnTopZ:
raise ValueError("Both returnTopZ and returnBottomZ are set to `True`")
Expand Down Expand Up @@ -982,9 +982,9 @@ def getBlocksBetweenElevations(self, zLower, zUpper):
Examples
--------
If the block structure looks like:
50.0 to 100.0 Block3
25.0 to 50.0 Block2
0.0 to 25.0 Block1
50.0 to 100.0 Block3
25.0 to 50.0 Block2
0.0 to 25.0 Block1
Then,
Expand Down
2 changes: 1 addition & 1 deletion armi/reactor/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2049,7 +2049,7 @@ def rotatePins(self, rotNum, justCompute=False):
Examples
--------
rotateIndexLookup[i_after_rotation-1] = i_before_rotation-1
rotateIndexLookup[i_after_rotation-1] = i_before_rotation-1
"""
if not 0 <= rotNum <= 5:
raise ValueError(
Expand Down
4 changes: 2 additions & 2 deletions armi/reactor/converters/geometryConverters.py
Original file line number Diff line number Diff line change
Expand Up @@ -1399,8 +1399,8 @@ class EdgeAssemblyChanger(GeometryChanger):
Examples
--------
edgeChanger = EdgeAssemblyChanger()
edgeChanger.removeEdgeAssemblies(reactor.core)
edgeChanger = EdgeAssemblyChanger()
edgeChanger.removeEdgeAssemblies(reactor.core)
"""

def addEdgeAssemblies(self, core):
Expand Down
10 changes: 5 additions & 5 deletions armi/reactor/converters/uniformMesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
Examples
--------
converter = uniformMesh.NeutronicsUniformMeshConverter()
converter.convert(reactor)
uniformReactor = converter.convReactor
# do calcs, then:
converter.applyStateToOriginal()
converter = uniformMesh.NeutronicsUniformMeshConverter()
converter.convert(reactor)
uniformReactor = converter.convReactor
# do calcs, then:
converter.applyStateToOriginal()
The mesh mapping happens as described in the figure:
Expand Down
8 changes: 4 additions & 4 deletions armi/reactor/reactors.py
Original file line number Diff line number Diff line change
Expand Up @@ -2585,10 +2585,10 @@ def buildManualZones(self, cs):
--------
Manual zones will be defined in a special string format, e.g.:
zoneDefinitions:
- ring-1: 001-001
- ring-2: 002-001, 002-002
- ring-3: 003-001, 003-002, 003-003
>>> zoneDefinitions:
>>> - ring-1: 001-001
>>> - ring-2: 002-001, 002-002
>>> - ring-3: 003-001, 003-002, 003-003
Notes
-----
Expand Down
8 changes: 4 additions & 4 deletions armi/reactor/zones.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,10 +446,10 @@ def summary(self) -> None:
Examples
--------
zoneDefinitions:
- ring-1: 001-001
- ring-2: 002-001, 002-002
- ring-3: 003-001, 003-002, 003-003
zoneDefinitions:
- ring-1: 001-001
- ring-2: 002-001, 002-002
- ring-3: 003-001, 003-002, 003-003
"""
# log a quick header
runLog.info("zoneDefinitions:")
Expand Down
2 changes: 1 addition & 1 deletion armi/settings/fwSettings/tightCouplingSettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class TightCouplingSettings(dict):
Examples
--------
couplingSettings = TightCouplingSettings({'globalFlux': {'parameter': 'keff', 'convergence': 1e-05}})
couplingSettings = TightCouplingSettings({'globalFlux': {'parameter': 'keff', 'convergence': 1e-05}})
"""

def __repr__(self):
Expand Down
2 changes: 1 addition & 1 deletion armi/utils/mathematics.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def convertToSlice(x, increment=False):
Examples
--------
a = np.array([10, 11, 12, 13])
>>> a = np.array([10, 11, 12, 13])
>>> convertToSlice(2)
slice(2, 3, None)
Expand Down

0 comments on commit 030e934

Please sign in to comment.