Skip to content

Commit

Permalink
Removing reference to CaseSettings class (terrapower#1586)
Browse files Browse the repository at this point in the history
  • Loading branch information
john-science authored Jan 17, 2024
1 parent bceafc9 commit f2d99cd
Show file tree
Hide file tree
Showing 21 changed files with 59 additions and 55 deletions.
2 changes: 1 addition & 1 deletion armi/bookkeeping/db/database3.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ def loadGeometry(self):

def writeInputsToDB(self, cs, csString=None, geomString=None, bpString=None):
"""
Write inputs into the database based the CaseSettings.
Write inputs into the database based the Settings.
This is not DRY on purpose. The goal is that any particular Database
implementation should be very stable, so we dont want it to be easy to change
Expand Down
27 changes: 14 additions & 13 deletions armi/cases/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
# limitations under the License.

"""
The ``Case`` object is responsible for running, and executing a set of user inputs. Many
entry points redirect into ``Case`` methods, such as ``clone``, ``compare``, and ``run``.
The ``Case`` object is responsible for running, and executing a set of
user inputs. Many entry points redirect into ``Case`` methods, such as
``clone``, ``compare``, and ``run``.
The ``Case`` object provides an abstraction around ARMI inputs to allow for manipulation and
collection of cases.
The ``Case`` object provides an abstraction around ARMI inputs to allow
for manipulation and collection of cases.
See Also
--------
Expand Down Expand Up @@ -81,8 +82,8 @@ def __init__(self, cs, caseSuite=None, bp=None, geom=None):
Parameters
----------
cs : CaseSettings
CaseSettings for this Case
cs : Settings
Settings for this Case
caseSuite : CaseSuite, optional
CaseSuite this particular case belongs. Passing this in allows dependency
Expand All @@ -96,8 +97,8 @@ def __init__(self, cs, caseSuite=None, bp=None, geom=None):
``cs`` as needed.
geom : SystemLayoutInput, optional
SystemLayoutInput for this case. If not supplied, it will be loaded from the ``cs`` as
needed.
SystemLayoutInput for this case. If not supplied, it will be loaded from the
``cs`` as needed.
"""
self._startTime = time.time()
self._caseSuite = caseSuite
Expand Down Expand Up @@ -374,7 +375,7 @@ def run(self):

def _startCoverage(self):
"""Helper to the Case.run(): spin up the code coverage tooling,
if the CaseSettings file says to.
if the Settings file says to.
Returns
-------
Expand Down Expand Up @@ -402,7 +403,7 @@ def _startCoverage(self):
@staticmethod
def _endCoverage(userCovFile, cov=None):
"""Helper to the Case.run(): stop and report code coverage,
if the CaseSettings file says to.
if the Settings file says to.
Parameters
----------
Expand Down Expand Up @@ -468,7 +469,7 @@ def _getCoverageRcFile(userCovFile, makeCopy=False):

def _startProfiling(self):
"""Helper to the Case.run(): start the Python profiling,
if the CaseSettings file says to.
if the Settings file says to.
Returns
-------
Expand All @@ -485,7 +486,7 @@ def _startProfiling(self):
@staticmethod
def _endProfiling(profiler=None):
"""Helper to the Case.run(): stop and report python profiling,
if the CaseSettings file says to.
if the Settings file says to.
Parameters
----------
Expand Down Expand Up @@ -912,7 +913,7 @@ def copyInterfaceInputs(
Parameters
----------
cs : CaseSettings
cs : Settings
The source case settings to find input files
destination : str
The target directory to copy input files to
Expand Down
6 changes: 3 additions & 3 deletions armi/cases/inputModifiers/inputModifiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class InputModifier:
(This class is abstract.)
Subclasses must implement a ``__call__`` method accepting a ``CaseSettings``,
Subclasses must implement a ``__call__`` method accepting a ``Settings``,
``Blueprints``, and ``SystemLayoutInput``.
The class attribute ``FAIL_IF_AFTER`` should be a tuple defining what, if any,
Expand Down Expand Up @@ -64,7 +64,7 @@ class SamplingInputModifier(InputModifier):
(This class is abstract.)
Subclasses must implement a ``__call__`` method accepting a ``CaseSettings``,
Subclasses must implement a ``__call__`` method accepting a ``Settings``,
``Blueprints``, and ``SystemLayoutInput``.
This is a modified version of the InputModifier abstract class that imposes
Expand Down Expand Up @@ -110,7 +110,7 @@ class FullCoreModifier(InputModifier):
Notes
-----
Besides the core, other grids may also be of interest for expansion, like
Besides the Core, other grids may also be of interest for expansion, like
a grid that defines fuel management. However, the expansion of a fuel
management schedule to full core is less trivial than just expanding
the core itself. Thus, this modifier currently does not attempt
Expand Down
2 changes: 1 addition & 1 deletion armi/cases/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def discover(
"""
Finds case objects by searching for a pattern of inputs, and adds them to the suite.
This searches for CaseSettings input files and loads them to create Case objects.
This searches for Settings input files and loads them to create Case objects.
Parameters
----------
Expand Down
8 changes: 4 additions & 4 deletions armi/cases/suiteBuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ def addDegreeOfFreedom(self, inputModifiers):
Parameters
----------
inputModifiers : list(callable(CaseSettings, Blueprints, SystemLayoutInput))
inputModifiers : list(callable(Settings, Blueprints, SystemLayoutInput))
A list of callable objects with the signature
``(CaseSettings, Blueprints, SystemLayoutInput)``. When these objects are called
``(Settings, Blueprints, SystemLayoutInput)``. When these objects are called
they should perturb the settings, blueprints, and/or geometry by some amount determined
by their construction.
"""
Expand Down Expand Up @@ -121,7 +121,7 @@ def buildSuite(self, namingFunc=None):
and a tuple of InputModifiers used to edit the case. This should be enough information
for someone to derive a meaningful name.
The function should return a string specifying the path of the ``CaseSettings``, this
The function should return a string specifying the path of the ``Settings``, this
allows the user to specify the directories where each case will be run.
If not supplied the path will be ``./case-suite/<0000>/<title>-<0000>``, where
Expand Down Expand Up @@ -396,7 +396,7 @@ def buildSuite(self, namingFunc=None):
and a tuple of InputModifiers used to edit the case. This should be enough information
for someone to derive a meaningful name.
The function should return a string specifying the path of the ``CaseSettings``, this
The function should return a string specifying the path of the ``Settings``, this
allows the user to specify the directories where each case will be run.
If not supplied the path will be ``./case-suite/<0000>/<title>-<0000>``, where
Expand Down
2 changes: 1 addition & 1 deletion armi/cli/modify.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

r"""
"""
Search through a directory tree and modify ARMI settings in existing input
file(s). All valid settings may be used as keyword arguments.
"""
Expand Down
6 changes: 3 additions & 3 deletions armi/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ def specifyInputs(cs) -> Dict[Union[str, settings.Setting], List[str]]:
relative to the input directory. Absolute paths will not be copied anywhere.
The returned dictionary will enable the source CaseSettings object to
The returned dictionary will enable the source Settings object to
be updated to the new file location. While the dictionary keys are
recommended to be Setting objects, the name of the setting as a string,
e.g., "shuffleLogic", is still interpreted. If the string name does not
Expand All @@ -618,7 +618,7 @@ def specifyInputs(cs) -> Dict[Union[str, settings.Setting], List[str]]:
Parameters
----------
cs : CaseSettings
cs : Settings
The case settings for a particular Case
"""
return {}
Expand Down Expand Up @@ -740,7 +740,7 @@ def getActiveInterfaceInfo(cs):
Parameters
----------
cs : CaseSettings
cs : Settings
The case settings that activate relevant Interfaces
"""
interfaceInfo = []
Expand Down
4 changes: 2 additions & 2 deletions armi/operators/operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class Operator:
Attributes
----------
cs : CaseSettings object
cs : Settings
Global settings that define the run.
cycleNames : list of str
Expand Down Expand Up @@ -127,7 +127,7 @@ def __init__(self, cs):
Parameters
----------
cs : CaseSettings object
cs : Settings
Global settings that define the run.
Raises
Expand Down
2 changes: 1 addition & 1 deletion armi/physics/executers.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def __repr__(self):
return f"<{self.__class__.__name__}: {self.label}>"

def fromUserSettings(self, cs):
"""Set options from a particular CaseSettings object."""
"""Set options from a particular Settings object."""
raise NotImplementedError()

def fromReactor(self, reactor):
Expand Down
2 changes: 1 addition & 1 deletion armi/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def defineSettings() -> List:
Define configuration settings for this plugin.
This hook allows plugins to provide their own configuration settings, which can
participate in the :py:class:`armi.settings.caseSettings.CaseSettings`. Plugins
participate in the :py:class:`armi.settings.caseSettings.Settings`. Plugins
may provide entirely new settings to what are already provided by ARMI, as well
as new options or default values for existing settings. For instance, the
framework provides a ``neutronicsKernel`` setting for selecting which global
Expand Down
4 changes: 2 additions & 2 deletions armi/reactor/blueprints/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@


def loadFromCs(cs, roundTrip=False):
"""Function to load Blueprints based on supplied ``CaseSettings``."""
"""Function to load Blueprints based on supplied ``Settings``."""
from armi.utils import directoryChangers

with directoryChangers.DirectoryChanger(cs.inputDirectory, dumpOnException=False):
Expand Down Expand Up @@ -231,7 +231,7 @@ def constructAssem(self, cs, name=None, specifier=None):
Parameters
----------
cs : CaseSettings object
cs : Settings
Used to apply various modeling options when constructing an assembly.
name : str (optional, and should be exclusive with specifier)
Expand Down
4 changes: 2 additions & 2 deletions armi/reactor/blueprints/assemblyBlueprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ def construct(self, cs, blueprint):
Parameters
----------
cs : CaseSettings
CaseSettings object which containing relevant modeling options.
cs : Settings
Settings object which containing relevant modeling options.
blueprint : Blueprint
Root blueprint object containing relevant modeling options.
"""
Expand Down
4 changes: 2 additions & 2 deletions armi/reactor/blueprints/blockBlueprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ def construct(
Parameters
----------
cs : CaseSettings
CaseSettings object for the appropriate simulation.
cs : Settings
Settings object for the appropriate simulation.
blueprint : Blueprints
Blueprints object containing various detailed information, such as nuclides to model
Expand Down
2 changes: 1 addition & 1 deletion armi/reactor/converters/uniformMesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ def initNewReactor(sourceReactor, cs):
----------
sourceReactor : :py:class:`Reactor <armi.reactor.reactors.Reactor>` object.
original reactor to be copied
cs: CaseSetting object
cs: Setting
Complete settings object
"""
# developer note: deepcopy on the blueprint object ensures that all relevant blueprints
Expand Down
27 changes: 15 additions & 12 deletions armi/reactor/reactors.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@
# limitations under the License.

"""
Reactor objects represent the highest level in the hierarchy of structures that compose the system
to be modeled. Core objects represent collections of assemblies.
Core is a high-level object in the data model in ARMI. They contain assemblies which in turn contain
more refinement in representing the physical reactor. The reactor is the owner of many of the
plant-wide state variables such as keff, cycle, and node.
Reactor objects represent the highest level in the hierarchy of
structures that compose the system to be modeled. Core objects
represent collections of assemblies.
Core is a high-level object in the data model in ARMI. They
contain assemblies which in turn contain more refinement in
representing the physical reactor. The reactor is the owner of
many of the plant-wide state variables such as keff, cycle,
and node.
"""
from typing import Optional
import collections
Expand Down Expand Up @@ -170,7 +173,7 @@ def loadFromCs(cs) -> Reactor:
Parameters
----------
cs: CaseSettings
cs: Settings
A relevant settings object
Returns
Expand Down Expand Up @@ -559,7 +562,7 @@ def removeAssembliesInRing(self, ringNum, cs, overrideCircularRingMode=False):
----------
ringNum : int
The ring to remove
cs: CaseSettings
cs: Settings
A relevant settings object
overrideCircularRingMode : bool, optional
False ~ default: use circular/square/hex rings, just as the reactor defines them
Expand Down Expand Up @@ -1810,7 +1813,7 @@ def createFreshFeed(self, cs=None):
Parameters
----------
cs : CaseSettings object
cs : Settings
Global settings for the case
See Also
Expand All @@ -1829,7 +1832,7 @@ def createAssemblyOfType(self, assemType=None, enrichList=None, cs=None):
The assembly type to create
enrichList : list
weight percent enrichments of each block
cs : CaseSettings object
cs : Settings
Global settings for the case
Returns
Expand Down Expand Up @@ -2449,12 +2452,12 @@ def processLoading(self, cs, dbLoad: bool = False):

def buildManualZones(self, cs):
"""
Build the Zones that are defined manually in the given CaseSettings file,
Build the Zones that are defined manually in the given Settings file,
in the `zoneDefinitions` setting.
Parameters
----------
cs : CaseSettings
cs : Settings
The standard ARMI settings object
Examples
Expand Down
2 changes: 1 addition & 1 deletion armi/reactor/systemLayoutInput.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ def fromReactor(cls, reactor):

@classmethod
def loadFromCs(cls, cs):
"""Function to load Geoemtry based on supplied ``CaseSettings``."""
"""Function to load Geoemtry based on supplied ``Settings``."""
if not cs["geomFile"]:
return None

Expand Down
2 changes: 1 addition & 1 deletion armi/settings/settingsIO.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class SettingsReader:
Parameters
----------
cs : CaseSettings
cs : Settings
The settings object to read into
"""

Expand Down
2 changes: 1 addition & 1 deletion armi/settings/tests/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def defineSettings():
]


class TestCaseSettings(unittest.TestCase):
class TestSettings(unittest.TestCase):
def setUp(self):
self.cs = caseSettings.Settings()

Expand Down
2 changes: 1 addition & 1 deletion armi/tests/tutorials/data_model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"With this `CaseSettings` object, we could create a brand new `Case` and `Operator` and do all sorts of magic. This way of interacting with ARMI is rather advanced, and beyond the scope of this tutorial."
"With this `Settings` object, we could create a brand new `Case` and `Operator` and do all sorts of magic. This way of interacting with ARMI is rather advanced, and beyond the scope of this tutorial."
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion doc/developer/guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ cases, launch the GUI, and perform various testing and utility operations. When
invoke ARMI with ``python -m armi run``, the ``__main__.py`` file is loaded and all
valid Entry Points are dynamically loaded. The proper entry point (in this case,
:py:class:`armi.cli.run.RunEntryPoint`) is invoked. As ARMI initializes itself, settings
are loaded into a :py:class:`CaseSettings <armi.settings.caseSettings.CaseSettings>`
are loaded into a :py:class:`Settings <armi.settings.caseSettings.Settings>`
object. From those settings, an :py:class:`Operator <armi.operators.operator.Operator>`
subclass is built by a factory and its ``operate`` method is called. This fires up the
main ARMI analysis loop and its interface stack is looped over as indicated by user
Expand Down
Loading

0 comments on commit f2d99cd

Please sign in to comment.