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

added check for a None soln export #1616

Merged
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
1 change: 1 addition & 0 deletions framework/Optimizers/Optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ def __init__(self):
self._initSampler = None # sampler to use for picking initial seeds
self._constraintFunctions = [] # list of constraint functions
self._impConstraintFunctions = [] # list of implicit constraint functions
self._requireSolnExport = True # optimizers only produce result in solution export
# __private
# additional methods
self.addAssemblerObject('Constraint', InputData.Quantity.zero_to_infinity) # Explicit (input-based) constraints
Expand Down
3 changes: 3 additions & 0 deletions framework/Samplers/AdaptiveSampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def __init__(self):
self._inputIdentifiers = {} # identifiers for a single realization
self._targetEvaluation = None # data object with feedback from sample realizations
self._solutionExport = None # data object for solution printing
self._requireSolnExport = False # if this object requires a solution export
# NOTE TargetEvaluations consider all the Step <Output> DataObjects as candidates, so requiring
# exactly one TargetEvaluation forces only having one <Output> DataObject in AdaptiveSampling
# MultiRun Steps. For now, we leave it as "n".
Expand All @@ -76,6 +77,8 @@ def initialize(self, externalSeeding=None, solutionExport=None):
@ Out, None
"""
self._targetEvaluation = self.assemblerDict['TargetEvaluation'][0][3]
if self._requireSolnExport and solutionExport is None:
self.raiseAnError(IOError, 'No <SolutionExport> found this step! Required for this sampling strategy.')
self._solutionExport = solutionExport
Sampler.initialize(self, externalSeeding=externalSeeding, solutionExport=solutionExport)
self._validateSolutionExportVariables(solutionExport)
Expand Down