-
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.
Add capability to handle interdependent functions in samplers/optimiz…
…ers (#2319) * moved samplers-optimizers function tests in their own folder for clarity * renamed * modified test names and revisions * moved subfolders * Closes #2302 * usage base class function evaluation method in ensembleForward * added error msg for detection of loop in function system * added test for ensemble model passing strings (restart file paths) around * removed trailing spaces * Update ravenframework/Samplers/EnsembleForward.py * Update ravenframework/Samplers/Sampler.py * Update ravenframework/Samplers/Sampler.py * Update ravenframework/Samplers/Sampler.py * fixed comment * we always check for isolated functions * updated model.tex * changed order to reflect order of appearance in the introduction of the Model sections * modified test description to make them latex compatible * specialization for EnsembleForward and CustomSampler * Apply suggestions from code review addressed Congjian's comments * Apply suggestions from code review * Apply suggestions from code review * Update ravenframework/Samplers/Sampler.py * updated setuptools dep * updated to simply ver 69 * added utility function as Congjian's request * plot entity * model order * added starting models * Apply suggestions from code review * Update ravenframework/utils/graphStructure.py --------- Co-authored-by: Congjian Wang - INL <congjian.wang@inl.gov>
- Loading branch information
Showing
40 changed files
with
609 additions
and
59 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,6 @@ | |
matplotlib.use('Agg') | ||
|
||
|
||
|
||
class Plot(OutStreamEntity): | ||
""" | ||
Handler for Plot implementations | ||
|
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
34 changes: 34 additions & 0 deletions
34
...esFunctionsSamplersOptimizers/InterdependentVariableFunctions/interdependent_functions.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,34 @@ | ||
# 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. | ||
import imp | ||
import os | ||
# the functions below are imported from the respective files | ||
# this is aimed to show how multiple functions can be coded in the same file | ||
d_calc = imp.load_source('d_calc', os.path.join(os.path.dirname(os.path.abspath(__file__)),'../RedundantInputs/d_calc.py')) | ||
|
||
def raven_d_calc_f_a_c(ravenContainer): | ||
return d_calc.evaluate(ravenContainer) | ||
|
||
def raven_e_calc_f_a_c(ravenContainer): | ||
return ravenContainer.a + ravenContainer.c | ||
|
||
def raven_b_calc_f_a(ravenContainer): | ||
return ravenContainer.a*1.2 | ||
|
||
def raven_c_calc_f_b(ravenContainer): | ||
return ravenContainer.b*1.2 | ||
|
||
def raven_z_l_calc_f_a(ravenContainer): | ||
return ravenContainer.a*1.2 | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
...work/VariablesFunctionsSamplersOptimizers/gold/InterdependentVariableFunctions/mc_out.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,3 @@ | ||
a,b,c,d,e,z,l,f,g,h | ||
2.37409342951,2.84891211541,3.41869453849,8.11630024131,5.79278796799,2.84891211541,2.84891211541,6.76358203682,3.38917233333,17.1417897746 | ||
4.35373093545,5.22447712254,6.26937254705,27.295161204,10.6231034825,5.22447712254,5.22447712254,22.7459674737,10.3522616,56.6023944473 |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.