-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensemble Model Connections Improvement (#732)
* fix the graph theory used to check the connections between different models * add test * resolve comments, update tests and docstring
- Loading branch information
Showing
12 changed files
with
383 additions
and
32 deletions.
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
24 changes: 24 additions & 0 deletions
24
tests/framework/ensembleModelTests/checkConnection/alpha.py
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Copyright 2017 Battelle Energy Alliance, LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
def run(self, Input): | ||
""" | ||
A dummy model used to check the connections for the EnsembleModel | ||
@ In, self, object, object to store members on | ||
@ In, Input, dict, dictionary containing inputs from RAVEN | ||
@ Out, None | ||
""" | ||
self.A = Input.get('A') | ||
self.B = Input.get('B') | ||
self.C = self.A + self.B |
24 changes: 24 additions & 0 deletions
24
tests/framework/ensembleModelTests/checkConnection/beta.py
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Copyright 2017 Battelle Energy Alliance, LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
def run(self, Input): | ||
""" | ||
A dummy model used to check the connections for the EnsembleModel | ||
@ In, self, object, object to store members on | ||
@ In, Input, dict, dictionary containing inputs from RAVEN | ||
@ Out, None | ||
""" | ||
self.C = Input.get('C') | ||
self.D = Input.get('D') | ||
self.E = self.C - self.D + 1.0 |
23 changes: 23 additions & 0 deletions
23
tests/framework/ensembleModelTests/checkConnection/delta.py
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Copyright 2017 Battelle Energy Alliance, LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
def run(self, Input): | ||
""" | ||
A dummy model used to check the connections for the EnsembleModel | ||
@ In, self, object, object to store members on | ||
@ In, Input, dict, dictionary containing inputs from RAVEN | ||
@ Out, None | ||
""" | ||
self.E = Input.get('E') | ||
self.F = self.E + 1.0 |
23 changes: 23 additions & 0 deletions
23
tests/framework/ensembleModelTests/checkConnection/epsilon.py
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Copyright 2017 Battelle Energy Alliance, LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
def run(self, Input): | ||
""" | ||
A dummy model used to check the connections for the EnsembleModel | ||
@ In, self, object, object to store members on | ||
@ In, Input, dict, dictionary containing inputs from RAVEN | ||
@ Out, None | ||
""" | ||
self.H = Input.get('H') | ||
self.G = self.H + 3.0 |
23 changes: 23 additions & 0 deletions
23
tests/framework/ensembleModelTests/checkConnection/gamma.py
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Copyright 2017 Battelle Energy Alliance, LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
def run(self, Input): | ||
""" | ||
A dummy model used to check the connections for the EnsembleModel | ||
@ In, self, object, object to store members on | ||
@ In, Input, dict, dictionary containing inputs from RAVEN | ||
@ Out, None | ||
""" | ||
self.G = Input.get('G') | ||
self.D = self.G + 1.0 |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Copyright 2017 Battelle Energy Alliance, LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
def run(self, Input): | ||
""" | ||
A dummy model used to check the connections for the EnsembleModel | ||
@ In, self, object, object to store members on | ||
@ In, Input, dict, dictionary containing inputs from RAVEN | ||
@ Out, None | ||
""" | ||
self.D = Input.get('D') | ||
self.I = self.D - 1.0 |
13 changes: 13 additions & 0 deletions
13
tests/framework/ensembleModelTests/gold/checkConnection/printData.csv
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
A,B,C,D,E,F,G | ||
0.0,2.0,2.0,9.0,-6.0,-5.0,8.0 | ||
0.0,2.0,2.0,10.5,-7.5,-6.5,9.5 | ||
0.0,2.0,2.0,12.0,-9.0,-8.0,11.0 | ||
0.0,3.0,3.0,9.0,-5.0,-4.0,8.0 | ||
0.0,3.0,3.0,10.5,-6.5,-5.5,9.5 | ||
0.0,3.0,3.0,12.0,-8.0,-7.0,11.0 | ||
1.0,2.0,3.0,9.0,-5.0,-4.0,8.0 | ||
1.0,2.0,3.0,10.5,-6.5,-5.5,9.5 | ||
1.0,2.0,3.0,12.0,-8.0,-7.0,11.0 | ||
1.0,3.0,4.0,9.0,-4.0,-3.0,8.0 | ||
1.0,3.0,4.0,10.5,-5.5,-4.5,9.5 | ||
1.0,3.0,4.0,12.0,-7.0,-6.0,11.0 |
Oops, something went wrong.