diff --git a/armi/interfaces.py b/armi/interfaces.py index 8e96b3ffb..b0d2721dc 100644 --- a/armi/interfaces.py +++ b/armi/interfaces.py @@ -47,6 +47,10 @@ class STACK_ORDER: # noqa: invalid-class-name Each module specifies an ``ORDER`` constant that specifies where in this order it should be placed in the Interface Stack. + .. impl:: Define an ordered list of interfaces. + :id: I_ARMI_OPERATOR_INTERFACES0 + :implements: R_ARMI_OPERATOR_INTERFACES + Notes ----- Originally, the ordering was accomplished with a very large if/else construct in ``createInterfaces``. @@ -84,7 +88,11 @@ class STACK_ORDER: # noqa: invalid-class-name class TightCoupler: """ Data structure that defines tight coupling attributes that are implemented - within an Interface and called upon when ``interactCoupled`` is called. + within an Interface and called upon when ``interactAllCoupled`` is called. + + .. impl:: The TightCoupler defines the convergence criteria for physics coupling. + :id: I_ARMI_OPERATOR_PHYSICS0 + :implements: R_ARMI_OPERATOR_PHYSICS Parameters ---------- @@ -240,6 +248,10 @@ class Interface: Interface instances are gathered into an interface stack in :py:meth:`armi.operators.operator.Operator.createInterfaces`. + + .. impl:: The interface shall allow code execution at important operational points in time. + :id: I_ARMI_INTERFACE + :implements: R_ARMI_INTERFACE """ # list containing interfaceClass diff --git a/armi/materials/__init__.py b/armi/materials/__init__.py index 02eaa38cb..5fb42d25a 100644 --- a/armi/materials/__init__.py +++ b/armi/materials/__init__.py @@ -46,6 +46,13 @@ def setMaterialNamespaceOrder(order): + """ + Set the material namespace order at the Python interpretter, global level. + + .. impl:: Materials can be searched across packages in a defined namespace. + :id: I_ARMI_MAT_NAMESPACE + :implements: R_ARMI_MAT_NAMESPACE + """ global _MATERIAL_NAMESPACE_ORDER _MATERIAL_NAMESPACE_ORDER = order @@ -121,6 +128,10 @@ def resolveMaterialClassByName(name: str, namespaceOrder: List[str] = None): gets used (Framework's UO2 vs. a user plugins UO2 vs. the Kentucky Transportation Cabinet's UO2) is up to the user at runtime. + .. impl:: Material collections are defined with an order of precedence in the case of duplicates. + :id: I_ARMI_MAT_ORDER + :implements: R_ARMI_MAT_ORDER + Parameters ---------- name : str diff --git a/armi/materials/material.py b/armi/materials/material.py index c5592db4d..cdf4af64f 100644 --- a/armi/materials/material.py +++ b/armi/materials/material.py @@ -36,6 +36,14 @@ class Material: """ A material is made up of elements or isotopes. It has bulk properties like mass density. + .. impl:: The abstract material class. + :id: I_ARMI_MAT_PROPERTIES + :implements: R_ARMI_MAT_PROPERTIES + + .. impl:: Materials generate nuclide mass fractions at instantiation. + :id: I_ARMI_MAT_FRACS + :implements: R_ARMI_MAT_FRACS + Attributes ---------- parent : Component @@ -94,7 +102,13 @@ def __repr__(self): @property def name(self): - """Getter for the private name attribute of this Material.""" + """ + Getter for the private name attribute of this Material. + + .. impl:: The name of a material is accessible. + :id: I_ARMI_MAT_NAME + :implements: R_ARMI_MAT_NAME + """ return self._name @name.setter @@ -707,6 +721,10 @@ def getThermalExpansionDensityReduction(self, prevTempInC, newTempInC): def linearExpansion(self, Tk=None, Tc=None): """For void, lets just not allow temperature changes to change dimensions since it is a liquid it will fill its space. + + .. impl:: Fluid materials are not thermally expandable. + :id: I_ARMI_MAT_FLUID + :implements: R_ARMI_MAT_FLUID """ return 0.0 diff --git a/armi/materials/void.py b/armi/materials/void.py index 34d3ffec9..eff62c309 100644 --- a/armi/materials/void.py +++ b/armi/materials/void.py @@ -21,6 +21,13 @@ class Void(material.Fluid): + """A Void material is a bookkeeping material with zero density. + + .. impl:: Define a void material with zero density. + :id: I_ARMI_MAT_VOID + :implements: R_ARMI_MAT_VOID + """ + def pseudoDensity(self, Tk: float = None, Tc: float = None) -> float: return 0.0 diff --git a/armi/operators/operator.py b/armi/operators/operator.py index 48a83e19e..9984c7e06 100644 --- a/armi/operators/operator.py +++ b/armi/operators/operator.py @@ -73,6 +73,10 @@ class Operator: .. note:: The :doc:`/developer/guide` has some additional narrative on this topic. + .. impl:: The operator package shall expose an ordered list of interfaces, and loop over them in order. + :id: I_ARMI_OPERATOR_INTERFACES1 + :implements: R_ARMI_OPERATOR_INTERFACES + Attributes ---------- cs : CaseSettings object @@ -650,6 +654,10 @@ def interactAllCoupled(self, coupledIteration): This is distinct from loose coupling, which would simply uses the temperature values from the previous timestep in the current flux solution. It's also distinct from full coupling where all fields are solved simultaneously. ARMI supports tight and loose coupling. + + .. impl:: Physics coupling is driven from Operator. + :id: I_ARMI_OPERATOR_PHYSICS1 + :implements: R_ARMI_OPERATOR_PHYSICS """ activeInterfaces = [ii for ii in self.interfaces if ii.enabled()] diff --git a/armi/physics/neutronics/globalFlux/globalFluxInterface.py b/armi/physics/neutronics/globalFlux/globalFluxInterface.py index 5c5d20471..3b998b8f6 100644 --- a/armi/physics/neutronics/globalFlux/globalFluxInterface.py +++ b/armi/physics/neutronics/globalFlux/globalFluxInterface.py @@ -334,6 +334,10 @@ def getLabel(caseTitle, cycle, node, iteration=None): class GlobalFluxOptions(executers.ExecutionOptions): """Data structure representing common options in Global Flux Solvers. + .. impl:: Options for neutronics solvers. + :id: I_ARMI_FLUX_OPTIONS + :implements: R_ARMI_FLUX_OPTIONS + Attributes ---------- adjoint : bool @@ -528,6 +532,10 @@ def _performGeometryTransformations(self, makePlots=False): In both cases, we need to undo the modifications between reading the output and applying the result to the data model. + .. impl:: Ensure the mesh in the reactor model is appropriate for neutronics solver execution. + :id: I_ARMI_FLUX_RX_RATES + :implements: R_ARMI_FLUX_RX_RATES + See Also -------- _undoGeometryTransformations @@ -1244,6 +1252,10 @@ def calcReactionRates(obj, keff, lib): r""" Compute 1-group reaction rates for this object (usually a block). + .. impl:: Return the reaction rates for a given ArmiObject. + :id: I_ARMI_FLUX_RX_RATES + :implements: R_ARMI_FLUX_RX_RATES + Parameters ---------- obj : Block diff --git a/armi/physics/neutronics/globalFlux/tests/test_globalFluxInterface.py b/armi/physics/neutronics/globalFlux/tests/test_globalFluxInterface.py index ff8957660..5c5b4f131 100644 --- a/armi/physics/neutronics/globalFlux/tests/test_globalFluxInterface.py +++ b/armi/physics/neutronics/globalFlux/tests/test_globalFluxInterface.py @@ -104,6 +104,14 @@ def getKeff(self): class TestGlobalFluxOptions(unittest.TestCase): + """ + Tests for GlobalFluxOptions. + + .. test:: Tests GlobalFluxOptions + :id: T_ARMI_FLUX_OPTIONS + :tests: R_ARMI_FLUX_OPTIONS + """ + def test_readFromSettings(self): cs = settings.Settings() opts = globalFluxInterface.GlobalFluxOptions("neutronics-run") diff --git a/armi/plugins.py b/armi/plugins.py index d128bcddb..79cb8ba69 100644 --- a/armi/plugins.py +++ b/armi/plugins.py @@ -169,6 +169,10 @@ def defineParameters() -> Dict: """ Function for defining additional parameters. + .. impl:: Plugins can add parameters to the reactor data model. + :id: I_ARMI_PLUGIN_PARAMS + :implements: R_ARMI_PLUGIN_PARAMS + Returns ------- dict @@ -372,6 +376,10 @@ def defineSettings() -> List: neutronics kernel (let's say MCNP), it should also define a new option to tell the settings system that ``"MCNP"`` is a valid option. + .. impl:: Plugins can add settings to the run. + :id: I_ARMI_PLUGIN_SETTINGS + :implements: R_ARMI_PLUGIN_SETTINGS + Returns ------- list