Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for a reactor to be loaded without setting its cs to the master #944

Merged
merged 2 commits into from
Oct 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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