The model data used in the exercises is an adapted version of a GEM hazard model for the Dominican Republic. This is based in work by Sunstone Risk, further details o which can be found here. In the full implementation different intensity measures are used depending on the risk, but in the workshop version we have a simplified version using PGA only.
The Oasis ecosystem has four main components.
-
Oasis Platform - Data standards, an API, tools and components for building and running catastrophe models.
-
Oasis User Interface - Web based application for uploading exposure, running models deployed in Oasis, and retrieving results (via the MDK).
-
Oasis Model Development Kit - Command line toolkit and reusable libraries for building, calibrating and creating the deployment assets for Oasis-ready models. It can also be used independently to run Oasis models end-to-end locally, or remotely via the Oasis API.
-
Oasis Model Library - Hosted catalogue for Oasis-ready models.
The ecosystem is shown in the diiagram below.
This excercises in this workshop will illustrate how the components of the ecosystem fit together, and how different components can be used together at different points of model development, deplyment and execution.
The pre-requisites for the system on an Ubuntu based system are listed in apt.txt. These can be installed by running the following command. Note that this is not required if your environment has been provided as part of an Oasis workshop.
cat apt.txt | xargs sudo apt-get install -y
If using another distribution then the comparable packages will need to be identified and installed, or alternatively use a Docker image.
We recommend using a Python virtual environment for running the exercises. To set up the your virtual environment, run the following commands in the project root directory. Note that Python 3.6 is required for the Oasis MDK.
virtualenv -p /usr/bin/python3.6 venv
source venv/bin/activate
pip install -r requirements.txt
pip install ipykernel
ipython kernel install --user --name=OasisWorkshop2018
The full model data also needs to be created from smaller files, that are compabable with Git file size restrictions:
cat gem/model_data/GMO/footprint_data/* > gem/model_data/GMO/footprint.csv
Jupyter, which is used for the first two exercises, can be launched by running the following command within the virtualenv:
jupyter notebook --NotebookApp.token='' --NotebookApp.password='' --no-browser --port=8888 --ip=0.0.0.0 --NotebookApp.base_url=/jupyter --allow-root
The first two exercises are provided either as interactive Jupyter notebooks. Jupyter is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text. The other excercies will be ran directlt from the Linux shell.
In this exercise you will create and validate some exposure in OED format. For the exercise details, go to the exercise_1 Jupyter notebook.
- Understand the basic structure of the OED format.
- Use Python code to create exposure data.
- Use the Oasis MDK to run deterministic analyses for direct and reinsurance contracts.
In this exercise you will look at the various files that constitute an Oasis model, then run an analysis using the MDK. For the exercise details, go to the exercise_2 Jupyter notebook.
- Understand the Oasis model files.
- Use Python code to view the model files for an example model.
- Use the Oasis MDK to create exposure and run deterministic analyses for direct and reinsurance contracts.
In this exercise you will run an analysis using the Oasis API. First, we need to start the API by running the following commands:
cd gem
docker-compose up -d
docker ps -a
For the exercise details, go to the exercise_3 Jupyter notebook.
- Understand the Oasis API.
- Use Python code to run an analysis via the API.
In this exercise you will run an analysis using the Oasis UI.
docker-compose -f docker-compose.oasis_ui.yml -f docker-compose.yml up -d
docker ps -a
- Introduction to the Oasis UI.
- Jupyter project
- Interactive notebooks - sharing the code (Nature article)
- Docker project
- R-tree spatial indexes
The code in this project is licensed under BSD 3-clause license.