Skip to content

GeoscienceAustralia/sira

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SIRA

Overview

The detailed documentation is at this link.

SIRA stands for Systemic Infrastructure Resilience Analysis. It represents a methodology and supporting code for systematising vulnerability analysis of lifeline infrastructure to natural hazards (i.e. response of infrastructure assets to environmental excitation). SIRA is open source.

The impact assessment is based on the fragilities and configuration of components that comprise the infrastructure system under study. The analytical process is supplemented by an assessment of the system functionality through the post-damage network flow analysis, and approximations for recovery timeframes.

The current focus has been on studying responses of infrastructure facilities (e.g. power generation plants, high voltage substations). Considerable work has been done in the code backend to extend the same methodology to modelling network vulnerability as well (e.g. electricity transmission networks).

SIRA models are based on graph theory. All infrastructure systems are represented as networks. This allows an user to develop arbitrarily complex models of a infrastructure facility or a network to be used in impact simulation.

Setup Instructions

It is good practice to set up a virtual environment for working with developing code. This gives us the tools to manage the package dependencies and requirements in a transparent manner, and impact of dependency changes on software behaviour.

Set up the environment

The recommended process to set up the environment is to use mamba and uv. This approach works equally well in Windows and Linux, and within Docker. Move into the sira/installation directory, and use the provided conda environment file (yaml) and pip requirements file (txt) to install the required packages:

$ mamba env create -f sira_env.yml
$ mamba activate sira_env
$ pip install uv
$ uv pip install -r sira_req.txt

Required Directory Structure

To set up a scenario or impact simulation project, SIRA expects the following directory shown below.

    model_dir
    │
    ├── input
    │   ├── config_assetx.json
    │   └── model_assetx.json
    └── output
        ├── ...
        └── ...

Explanation of the required structure is as follows:

  • 'model directory' - it can be named anything

  • within the 'model directory', the 'input' dir must have two files, in specified format:

  • a model file: it must have the term 'model' at the beginning or end of the file name

  • a config file: it must have the term 'config' at the beginning or end of the file name

  • the outputs are saved in the 'output' dir. If it does not exist, the code will create it at the beginning of the simulation.

  • The output folder location can be specified in the config file.

Running the Application

The application can be run in a number of modes. The relevant options are:

-d <path_to_input_dir>, --input_directory <path_to_input_dir>
-s, --simulation
-f, --fit
-l, --loss_analysis

The following code snippets assume that it is being run from the root directory of the SIRA code, and the model of interest is in the location sira/scenario_dir/ci_model_x.

The following code runs the simulation and the post processing simultanrously:

$ python sira -d scenario_dir/ci_model_x -sfl

To run only the Monte Carlo simulation without post-processing:

$ python sira -d scenario_dir/ci_model_x -s

To run both the model fitting and the loss analysis code:

$ python sira -d scenario_dir/ci_model_x -fl

Note that the model fitting and loss analysis steps require that the initial simulation be run first so that it has the initial output data to perform the analysis on.

Testing

To run the tests, user needs to be in the root directory of the code, e.g. ~/code/sira. Then simply run:

$ pytest

If you want to explicitly ask pytest to run coverage reports, then run:

$ pytest --cov-report term --cov=sira tests/

If you are using docker as described above, you can do this from within the sira container.