UCL-CCS / EasyVVUQ

Python 3 framework to facilitate verification, validation and uncertainty quantification (VVUQ) for a wide variety of simulations.
https://easyvvuq.readthedocs.io/
GNU Lesser General Public License v3.0
85 stars 27 forks source link

Sensitivity analysis with correlated inputs #385

Closed goghino closed 1 year ago

goghino commented 1 year ago

The code contains method to perform sensitivity analysis of models with correlated inputs. The new SA is supported only by the PCE method. Changes include:

The new code is accompanied by a publication elaborating on the method, and a set of Jupyter notebooks demonstrating the functionality (at the moment located in external repository).

Running the test suite results in some errors, but I think they do not originate from my updates. Please verify. @djgroen


======================================== short test summary info =========================================
FAILED tests/test_SSC.py::test_adapt_locally - assert False
FAILED tests/test_mc_analysis_results.py::test_describe - AssertionError: assert {'10%': 0.081...20347433, ...} == {'mean': 0.46...4945020531205}
FAILED tests/test_vector.py::test_gauss_vector_pce - TypeError: len() of unsized object
ERROR tests/test_campaign.py::test_string - FileNotFoundError: [Errno 2] No such file or directory: '/Users/usi/switchdrive/Institution/usi/PhD/p...
ERROR tests/test_campaign.py::test_get_active_app - FileNotFoundError: [Errno 2] No such file or directory: '/Users/usi/switchdrive/Institution/usi/PhD/p...
ERROR tests/test_campaign.py::test_add_external_runs - FileNotFoundError: [Errno 2] No such file or directory: '/Users/usi/switchdrive/Institution/usi/PhD/p...
============== 3 failed, 143 passed, 5 skipped, 36 warnings, 3 errors in 257.08s (0:04:17) ===============```
djgroen commented 1 year ago

Hi all. This is a big pull request that needs wide scrutiny in my opinion. I do think the feature could find very widespread uptake, so I am in support of it. However, the code needs wide scrutiny :).

orbitfold commented 1 year ago

Where are the tests for this new functionality?

DavidPCoster commented 1 year ago

In order to understand a bit more about these changes, it would be good to have access to "The new code is accompanied by a publication elaborating on the method, and a set of Jupyter notebooks demonstrating the functionality (at the moment located in external repository)."

I might have missed where these were referenced, but could you make it easier to find them?

djgroen commented 1 year ago

@goghino Do you have any time to look into this perhaps?

goghino commented 1 year ago

@DavidPCoster I have added the jupyter notebooks to tutorials/correlated, there are two of them coffe_cup-pce.ipynb and coffe_cup-fd.ipynb. Regarding the publication, please find attached the preprint SApaper_submission.pdf

goghino commented 1 year ago

Added tests for the new functionality: create mode 100644 tests/test_fd_analysis.py create mode 100644 tests/test_fd_dep_analysis.py create mode 100644 tests/test_pce_der_analysis.py create mode 100644 tests/test_pce_der_dep_analysis.py

goghino commented 1 year ago

Is there anything else I can do for this pull request? @djgroen @DavidPCoster @wedeling

goghino commented 1 year ago

I see, I am using some recent python syntax not supported in older versions, that's why "build (3.7)" fails. I will try to downgrade my code to be compatible with old python versions.

@DavidPCoster can I run the tests you launched myself as well? Because I think I will not get it all fixed on my first go.

Edit: Conda is not officially supporting 3.7 ("Conda supports Python 3.8, 3.9, 3.10, and 3.11.")

DavidPCoster commented 1 year ago

I don’t know — I found a button to enable test runs, but that might not be available to everybody ...

On 31. May 2023, at 11:49, Juraj Kardoš @.***> wrote:

I see, I am using some recent python syntax not supported in older versions, that's why "build (3.7)" fails. I will try to downgrade my code to be compatible with old python versions.

@DavidPCoster https://github.com/DavidPCoster can I run the tests you launched myself as well? Because I think I will not get it all fixed on my first go

— Reply to this email directly, view it on GitHub https://github.com/UCL-CCS/EasyVVUQ/pull/385#issuecomment-1569860585, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJXIBISJ5UUWGLXFSK6HYRLXI4HY7ANCNFSM6AAAAAAU43E6HE. You are receiving this because you were mentioned.

goghino commented 1 year ago

I am not able to create environment with python 3.7. I can set up only environment with 3.8 and newer. But with python=3.8.16 most of the tests pass

============ 24 failed, 111 passed, 5 skipped, 1090 warnings, 29 errors in 131.81s (0:02:11) =============

The errors and failures are related to some missing files, e.g. ERROR test_campaign.py::test_get_active_app - FileNotFoundError: [Errno 2] No such file or directory: '... /opt/homebrew/anaconda3/envs/USI_test_p38/lib/python3.8/subprocess.py:1704: FileNotFoundError

can we skip python 3.7 for the moment?

DavidPCoster commented 1 year ago

Well, security updates for 3.7

Ends in 3 weeks and 6 days (27 Jun 2023)

So I think this should be OK. @djgroen , @orbitfold , @wedeling -- what do you think? If so, how do we disable the 3.7 tests?