Skip to content

Commit

Permalink
Allowing reactor to be loaded without masterCs (#944)
Browse files Browse the repository at this point in the history
  • Loading branch information
keckler committed Oct 19, 2022
1 parent f5be5ee commit 5462344
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
21 changes: 14 additions & 7 deletions armi/bookkeeping/db/database3.py
Original file line number Diff line number Diff line change
Expand Up @@ -1085,6 +1085,7 @@ def load(
statePointName=None,
allowMissing=False,
updateGlobalAssemNum=True,
updateMasterCs=True,
):
"""Load a new reactor from (cycle, node).
Expand All @@ -1100,18 +1101,23 @@ def load(
cycle number
node : int
time node
cs : armi.settings.Settings (optional)
cs : armi.settings.Settings, optional
if not provided one is read from the database
bp : armi.reactor.Blueprints (optional)
bp : armi.reactor.Blueprints, optional
if not provided one is read from the database
statePointName : str
statePointName : str, optional
Optional arbitrary statepoint name (e.g., "special" for "c00n00-special/")
allowMissing : bool
allowMissing : bool, optional
Whether to emit a warning, rather than crash if reading a database
with undefined parameters. Default False.
updateGlobalAssemNum : bool
updateGlobalAssemNum : bool, optional
Whether to update the global assembly number to the value stored in
r.core.p.maxAssemNum. Default True.
updateMasterCs : bool, optional
Whether to apply the cs (whether provided as an argument or read from
the database) as the primary for the case. Default True. Can be useful
if you don't intend to use the loaded reactor as the basis for further
computations in the current operator.
Returns
-------
Expand All @@ -1121,8 +1127,9 @@ def load(
runLog.info("Loading reactor state for time node ({}, {})".format(cycle, node))

cs = cs or self.loadCS()
# apply to avoid defaults in getMasterCs calls
settings.setMasterCs(cs)
if updateMasterCs:
# apply to avoid defaults in getMasterCs calls
settings.setMasterCs(cs)
bp = bp or self.loadBlueprints()

h5group = self.h5db[getH5GroupName(cycle, node, statePointName)]
Expand Down
1 change: 1 addition & 0 deletions doc/release/0.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ What's new in ARMI
#. Cleanup of stale ``coveragerc`` file (`PR#923 <https://github.com/terrapower/armi/pull/923>`_)
#. Added `medium` writer style option to ``SettingsWriter``. Added it as arg to modify CLI (`PR#924 <https://github.com/terrapower/armi/pull/924>`_), and to clone CLI (`PR#932 <https://github.com/terrapower/armi/pull/932>`_).
#. Update the EntryPoint class to provide user feedback on required positional arguments (`PR#922 <https://github.com/terrapower/armi/pull/922>`_)
#. Allow for the loading of a reactor from a db without necessarily setting the associated cs as the master

Bug fixes
---------
Expand Down

0 comments on commit 5462344

Please sign in to comment.