Skip to content

Commit

Permalink
Merge bc51d31 into bbfff10
Browse files Browse the repository at this point in the history
  • Loading branch information
john-science authored Oct 26, 2021
2 parents bbfff10 + bc51d31 commit 0cfaf08
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
4 changes: 4 additions & 0 deletions armi/cases/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ def __init__(self, cs, caseSuite=None, bp=None, geom=None):
self._dependencies: Set[Case] = set()
self.enabled = True

# set the signal if the user passes in a blueprint object, instead of a file
if bp is not None:
cs.filelessBP = True

# NOTE: in order to prevent slow submission times for loading massively large
# blueprints (e.g. certain computer-generated input files),
# self.bp and self.geom can be None.
Expand Down
9 changes: 2 additions & 7 deletions armi/cases/inputModifiers/inputModifiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,7 @@ def __call__(self, cs, bp, geom):


class BluePrintBlockModifier(InputModifier):
"""
Adjust blueprint block->component->dimension to specified value.
"""
"""Adjust blueprint block->component->dimension to specified value."""

def __init__(self, block, component, dimension, value):
InputModifier.__init__(self, independentVariable={dimension: value})
Expand All @@ -186,9 +184,6 @@ def __call__(self, cs, bp, geom):
if componentDesign.name == self.component:
# set new value
setattr(componentDesign, self.dimension, self.value)

# maybe this list of for and if could be replaced by
# one line like setattr(bp , 'self.block'.'self.component'.'self.dimension' , self.values)
# but not sure python can do that or should do that..
return cs, bp, geom

return cs, bp, geom
4 changes: 4 additions & 0 deletions armi/operators/settingsValidation.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,10 @@ def _inspectBlueprints(self):
"""Blueprints early error detection and old format conversions."""
from armi.reactor import blueprints

# if there is a blueprints object, we don't need to check for a file
if self.cs.filelessBP:
return

self.addQuery(
lambda: not self.cs["loadingFile"],
"No blueprints file loaded. Run will probably fail.",
Expand Down
2 changes: 2 additions & 0 deletions armi/settings/caseSettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ def __init__(self, fName=None):
fName : str, optional
Path to a valid yaml settings file that will be loaded
"""
# if the "loadingFile" is not set, this better be True, or there are no blueprints at all
self.filelessBP = False

self._failOnLoad = False
"""This is state information.
Expand Down

0 comments on commit 0cfaf08

Please sign in to comment.