-
Notifications
You must be signed in to change notification settings - Fork 135
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
Standardize collectOutput method for PostProcessor #1471
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
ac4ea6c
standardize collectOutput method for PostProcessor
wangcj05 c49294c
update collectOutput method in BasicStatistics
wangcj05 e0cf987
update collectOutput method for ETImporter
wangcj05 3ca284e
update collectOutput method for FTImporter
wangcj05 d5a4d95
update collectOutput method for MCSImporter
wangcj05 792e778
fix typo
wangcj05 6f9ff74
add Runners import in PostProcessor
wangcj05 baeaf6d
move self.outputDataset to PostProcessor base class
wangcj05 e984000
use both DataObject methods addRealization and load in collectOutput …
wangcj05 1dec8f4
update collectOutput method for ParetoFrontier and Realization Averager
wangcj05 4d1ccd0
clean up DataClassifier
wangcj05 2335e2a
standardize DataClassifier collectOutput method
wangcj05 a83f076
standardize the return from run, i.e. {'data':realizations, 'dims':dims}
wangcj05 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,6 +62,12 @@ def __init__(self, runInfoDict): | |
self.printTag = 'POSTPROCESSOR FT IMPORTER' | ||
self.FTFormat = None # chosen format of the FT file | ||
self.topEventID = None | ||
self.validDataType = ['PointSet'] # The list of accepted types of DataObject | ||
## Currently, we have used both DataObject.addRealization and DataObject.load to | ||
## collect the PostProcessor returned outputs. DataObject.addRealization is used to | ||
## collect single realization, while DataObject.load is used to collect multiple realizations | ||
## However, the DataObject.load can not be directly used to collect single realization | ||
self.outputMultipleRealizations = True | ||
|
||
def initialize(self, runInfo, inputs, initDict) : | ||
""" | ||
|
@@ -89,26 +95,20 @@ def run(self, inputs): | |
""" | ||
This method executes the postprocessor action. | ||
@ In, inputs, list, list of file objects | ||
@ Out, out, dict, dict containing the processed FT | ||
@ Out, outputDict, dict, dict containing the processed FT | ||
""" | ||
faultTreeModel = FTStructure(inputs, self.topEventID) | ||
return faultTreeModel.returnDict() | ||
outputDict = faultTreeModel.returnDict() | ||
outputDict = {'data': outputDict, 'dims':{}} | ||
return outputDict | ||
|
||
def collectOutput(self, finishedJob, output): | ||
def collectOutput(self, finishedJob, output, options=None): | ||
""" | ||
Function to place all of the computed data into the output object, (DataObjects) | ||
@ In, finishedJob, object, JobHandler object that is in charge of running this postprocessor | ||
@ In, finishedJob, object, JobHandler object that is in charge of running this PostProcessor | ||
@ In, output, object, the object where we want to place our computed results | ||
@ In, options, dict, optional, not used in PostProcessor. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we specify it since PP doesn't use it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It inherits from the Model base class. |
||
dictionary of options that can be passed in when the collect of the output is performed by another model (e.g. EnsembleModel) | ||
@ Out, None | ||
""" | ||
evaluation = finishedJob.getEvaluation() | ||
outputDict ={} | ||
outputDict['data'] = evaluation[1] | ||
|
||
outputDict['dims'] = {} | ||
for key in outputDict['data'].keys(): | ||
outputDict['dims'][key] = [] | ||
if output.type in ['PointSet']: | ||
output.load(outputDict['data'], style='dict', dims=outputDict['dims']) | ||
else: | ||
self.raiseAnError(RuntimeError, 'FTImporter failed: Output type ' + str(output.type) + ' is not supported.') | ||
PostProcessor.collectOutput(self, finishedJob, output, options=options) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this variable being used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is used to indicate what kind of method will be used to collect the output into the DataObjects. Currently, we have addRealization for single realization, and load method for multiple realizations.