idaholab / raven

RAVEN is a flexible and multi-purpose probabilistic risk analysis, validation and uncertainty quantification, parameter optimization, model reduction and data knowledge-discovering framework.
https://raven.inl.gov/
Apache License 2.0
212 stars 131 forks source link

Add capability to handle interdependent functions in samplers/optimizers #2319

Closed alfoa closed 1 month ago

alfoa commented 1 month ago

Pull Request Description

What issue does this change request address? (Use "#" before the issue to link it, i.e., #42.)

Closes #2302

What are the significant changes in functionality due to this change request?

Added the possibility to specify in Optimizers/Samplers variables (defined through functions) that are interdependent.

For example, lets assume we sample the variables

the variable what_dish_do_we_cook depends solely on these variables (and it is defined through a RAVEN <function>) and depending on the values of #_tomatos and #_Eggs the result of this function can be either be Carbonara or Amatriciana.

the variable which_pasta_should_we_use depends on the variable what_dish_do_we_cook: if

Based on this example, RAVEN will first sample #_Eggs, grams_Pancetta_or_Guanciale, grams_Pecorino_Cheese and #_tomatos; Then it evaluates the function that computes the variable what_dish_do_we_cook and finally it computes the variable which_pasta_should_we_use depending on the value of the variable what_dish_do_we_cook.

In addition to this capability, also a new test for the ensemble model testing/showing how to use it to transfer string variables from a model to the other using RAVEN variables has been added.


For Change Control Board: Change Request Review

The following review must be completed by an authorized member of the Change Control Board.

alfoa commented 1 month ago

@wangcj05 @joshua-cogliati-inl @mandd

Unfortunately new issue

... Activating environment ...
... Installing libraries from PIP-ONLY ...
...pip-only command: pip install netcdf4==1.6.* tensorflow==2.13.* grpcio dask[complete] ray[default]==2.6.* imageio==2.22.* python-sensors numdifftools==0.9.* xmlschema fmpy==0.3.16.*
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f54cfab2cb0>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /simple/netcdf4/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f54cfc26bc0>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /simple/netcdf4/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f54cfc25ab0>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /simple/netcdf4/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f54cfc26080>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /simple/netcdf4/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f54cfab30d0>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /simple/netcdf4/
ERROR: Could not find a version that satisfies the requirement netcdf4==1.6.* (from versions: none)
ERROR: No matching distribution found for netcdf4==1.6.*

ERROR: exiting with code 1
moosebuild commented 1 month ago

All jobs on d6e0159 : invalidated by @wangcj05

moosebuild commented 1 month ago

Job Mingw Test on 5c0f684 : invalidated by @alfoa

moosebuild commented 1 month ago

Job Mingw Test on 5c0f684 : invalidated by @alfoa

alfoa commented 1 month ago

Very confused about the failure of Failed tests/framework/InternalParallelTests/ExternalModelRay.

Merged devel and trying again.

moosebuild commented 1 month ago

Job Mingw Test on 2b2de17 : invalidated by @alfoa

alfoa commented 1 month ago

These failures are caused by a setuptool upgrade (https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/15863)

alfoa commented 1 month ago

(69.5.1) works, (70.0.0) doesnt

moosebuild commented 1 month ago

Job Mingw Test on 74e6708 : invalidated by @alfoa

fetch failure (again)

alfoa commented 1 month ago

@wangcj05 @joshua-cogliati-inl Windows fetch failing:

Date: Thu May 23 10:44:36 MDT 2024
Machine: VDI-RavenW10-01
OS Name:                   Microsoft Windows 10 Enterprise
OS Version:                10.0.19045 N/A Build 19045
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Member Workstation
OS Build Type:             Multiprocessor Free
Trigger: Pull request
Step: Fetch Raven (0)
No module system in place
Base commit: git@github.com:idaholab/raven.git:devel:5c291642f18f9fef6ff45213dbd98bad0a5a83a7
Head commit: git@github.com:idaholab/raven.git:alfoa/functions_graph_theory:74e67082bac72e32e36de7655454be832643f37d
fatal: not a git repository (or any of the parent directories): .git
git version 2.43.0.windows.1

/opt/build_root/raven/: Removing current repository C:/Git/opt/build_root/raven
/opt/build_root/raven/: rm -rf C:/Git/opt/build_root/raven
rm: cannot remove 'C:/Git/opt/build_root/raven/tests/framework/InternalParallelTests/InternalParallelExtModelRay': Device or resource busy
/opt/build_root/: Cloning idaholab/raven
/opt/build_root/: git clone -q https://github.com/idaholab/raven.git
fatal: destination path 'raven' already exists and is not an empty directory.

ERROR: exiting with code 128
moosebuild commented 1 month ago

Job Mingw Test on 74e6708 : invalidated by @alfoa

moosebuild commented 1 month ago

Job Mingw Test on 74e6708 : invalidated by @alfoa

moosebuild commented 1 month ago

Job Mingw Test on 74e6708 : invalidated by @alfoa

alfoa commented 1 month ago

@wangcj05 @joshua-cogliati-inl the windows machine seems to be down since days. Can we merge this without that test?

moosebuild commented 1 month ago

Job Mingw Test on 0fd2726 : invalidated by @wangcj05

moosebuild commented 1 month ago

Job Mingw Test on 0fd2726 : invalidated by @joshua-cogliati-inl

restarted civet

moosebuild commented 1 month ago

Job Mingw Test on 0fd2726 : invalidated by @joshua-cogliati-inl

restarted civet

moosebuild commented 1 month ago

Job Mingw Test on 0fd2726 : invalidated by @alfoa

alfoa commented 1 month ago

@wangcj05 @joshua-cogliati-inl Unfortunately windows machine still has issues... (now with the set environment).

moosebuild commented 1 month ago

Job Mingw Test on 62194cc : invalidated by @joshua-cogliati-inl

failed trying to download icu-73.2-h63175ca_0.conda

moosebuild commented 1 month ago

Job Mingw Test on 62194cc : invalidated by @joshua-cogliati-inl

updated conda

moosebuild commented 1 month ago

Job Mingw Test on 7b55395 : invalidated by @joshua-cogliati-inl

Failed in set python evnvironment (warning libmamba Could not parse mod/etag header)

alfoa commented 1 month ago

Is this good to be merged? @wangcj05 @joshua-cogliati-inl ?

wangcj05 commented 1 month ago

PR is good, and checklist is satisfied.