Python version of the Sensitivity Analysis for Everybody (SAFE) Toolbox.
An introduction to the SAFE Toolbox is provided in the paper:
Pianosi, F., Sarrazin, F., Wagener, T. (2015), A Matlab toolbox for Global Sensitivity Analysis, Environmental Modelling & Software, 70, 80-85. The paper is freely available at: https://doi.org/10.1016/j.envsoft.2015.04.009
We recommend reading this (short) paper before getting started. Other reading materials, including general introductions to Sensitivity Analysis and case study applications, can be found at: https://safetoolbox.github.io
pip install safepython
Download the SAFEpython source code to your computer. You go into the SAFE-Python folder and execute:
pip install .
-
You can execute the previous commands from python command line (e.g. Anaconda prompt).
-
From command line, you should use:
option 1: python -m pip install safepython
option 2: python -m pip install .
- For windows users: python cannot be called directly from Windows command line. You have to go into the folder in which python is installed and then execute:
option 1: python -m pip install safepython
option 2: python -m pip install mydir\SAFE-python
(mydir is the directory in which the SAFEpython folder is saved, and it shoud not contain which spaces)
- If you want to install the package without administrator rights, you may have to use:
pip install --user .
To get started using SAFE, we suggest opening one of the workflow scripts in the 'examples' folder available in the github repository and running the code step by step. The header of each workflow script gives a short description of the method and case study model, and of the main steps and purposes of that workflow, as well as references for further reading. The name of each workflow is composed as: workflow_method_model
Implemented models are:
- the hydrological Hymod model
- the hydrological HBV model
- the Ishigami and Homma test function
- the Sobol' g-function
Implemented methods are:
- eet (elementary effects test, or method of Morris)
- fast (Fourier amplitude sensitivity test)
- pawn
- rsa (regional sensitivity analysis)
- vbsa (variance-based sensitivity analysis, or method of Sobol')
Furthermore, SAFE includes additional workflow scripts:
- external: how to connect SAFE to a model running outside python
- tvsa: how to apply GSA methods to perform time-varying sensitivity analysis
- visual: how to use visualisation functions for qualitative GSA
If the user still has no clear idea of what method(s) to start with, we suggest one of the three most widely used methods: eet (e.g. workflow_eet_hymod), rsa (workflow_rsa_hymod), vbsa (workflow_vbsa_hymod) or the visualization workflow (workflow_visual_ishigami_homma.m).
Please make sure that you download the version of the 'examples' folder that corresponds to the version of SAFEpython package you are using. To use the latest version of SAFEpython, you can update the package using:
pip install --upgrade safepython
- numpy >= 1.19.2
- scipy >= 1.3.0
- numba >= 0.49.0
- matplotlib >= 2.2.3
If you would like to use the software, please cite it using the following:
Pianosi, F., Sarrazin, F., Wagener, T. (2015), A Matlab toolbox for Global Sensitivity Analysis, Environmental Modelling & Software, 70, 80-85, doi: 10.1016/j.envsoft.2015.04.009.