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

Add allowMissing kwarg to loadOperator #538

Merged
merged 1 commit into from Jan 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions armi/bookkeeping/db/__init__.py
Expand Up @@ -75,7 +75,7 @@
]


def loadOperator(pathToDb, loadCycle, loadNode):
def loadOperator(pathToDb, loadCycle, loadNode, allowMissing=False):
"""
Return an operator given the path to a database.

Expand All @@ -87,6 +87,9 @@ def loadOperator(pathToDb, loadCycle, loadNode):
The cycle to load the reactor state from.
loadNode : int
The time node to load the reactor from.
allowMissing : bool
Whether to emit a warning, rather than crash if reading a database
with undefined parameters. Default False.

See Also
--------
Expand Down Expand Up @@ -132,7 +135,7 @@ def loadOperator(pathToDb, loadCycle, loadNode):
cs = db.loadCS()
thisCase = cases.Case(cs)

r = db.load(loadCycle, loadNode)
r = db.load(loadCycle, loadNode, allowMissing=allowMissing)
settings.setMasterCs(cs)

# Update the global assembly number because, if the user is loading a reactor from
Expand Down