Skip to content
Snippets Groups Projects
Select Git revision
  • c59509069c7d35ad8baaedd2320be80c7e54e2d9
  • main default protected
  • ravaflow3g
  • docs
  • v0.1.2
  • v0.1.1
  • v0.1.0
7 results

psimpy

  • Clone with SSH
  • Clone with HTTPS
  • News

    Creating new issues by non-project members has temporarily been suspended. If you would like to report an issue, please send an e-mail to issues@mbd.rwth-aachen.de.

    Description

    PSimPy (Predictive and probabilistic simulation with Python) implements a Gaussian process emulation-based framework that enables systematic and efficient investigation of uncertainties associated with physics-based models (i.e. simulators).

    Installation

    PSimPy is a pure Python package and can be easily installed using pip. All Python-related dependencies are automatically taken care of. It should be noted that some modules of PSimPy rely on / take advantage of non-Python packages and software. More specifically, the emulator module robustgasp.py relies on the R package RobustGaSP; the simulator module ravaflow3G.py relies on the open source software r.avaflow 3G (which runs in GRASS GIS). If you want to use these or any other dependent modules, corresponding non-Python dependencies need to be installed.

    If the simulator module ravaflow3G.py is desired, you may follow the official documentation of r.avaflow 3G under https://www.landslidemodels.org/r.avaflow/ to install it. Only the installation of the R package RobustGaSP is covered in following steps.

    We recommond you to install PSimPy in a virtual environment such as a conda environment. You may want to first install Anaconda or Miniconda if you haven't. The steps afterwards are as follows:

    1. Create a conda environment with Python:

      $ conda create --name your_env_name python
    2. Install R if you don't have it on your machine (if you have R, you can skip this step; alternatively, you can still follow this step to install R in the conda environment):

      $ conda activate your_env_name
      $ conda install -c conda-forge r-base
    3. Install the R package RobustGaSP in the R terminal:

      $ R
      ...
      > install.packages("RobustGaSP",repos="https://cran.r-project.org",version="0.6.4")

      See if it is successfully installed with

      > library("RobustGaSP")
    4. Configure the environment variable R_HOME so that rpy2 knows where to find R packages. You can find your R_HOME by typing the following command in the R terminal:

      > R.home()
      > q()

      It is a path like ".../lib/R". Set the environment variable R_HOME in your conda environment with

      $ conda env config vars set R_HOME=your_R_HOME

      Afterwards reactivate your conda environment to make the change take effect by

      $ conda deactivate
      $ conda activate your_env_name
    5. Install PSimPy using pip in your conda environment by

      $ conda install -c conda-forge pip
      $ python -m pip install psimpy

    Now you should have PSimPy and its dependencies successfully installed in your conda environment. You can use it in the Python terminal or in your Python IDE.

    If you would like to use it with Jupyter Notebook (iPython Notebook), there is one extra step needed to set your conda environment on your Notebook:

    1. Install ipykernel and install a kernel that points to your conda environment with
      $ conda install -c conda-forge ipykernel
      $ python -m ipykernel install --user --name=your_env_name

    Now you can start your Notebook, change the kernel to your conda environment, and use PSimPy.

    Documentation

    Detailed documentation of PSimPy is hosted at https://mbd.pages.git-ce.rwth-aachen.de/psimpy, including the API and theory (or reference) of each module.

    Usage

    Usage examples are provided by the Example Gallery at https://mbd.pages.git-ce.rwth-aachen.de/psimpy.

    License

    PSimPy was created by Hu Zhao at the Chair of Methods for Model-based Development in Computational Engineering (RWTH Aachen University, Germany). It is licensed under the terms of the MIT license.