This repository contains project-specific codes and configuration to run climate-related risk and resilience analysis of infrastructure networks in Jamaica.
For an initial overview of the style of analysis, a table of potential data requirements is presented in data-categories.csv.
Clone or download this repository from GitHub:
git clone [email protected]:nismod/jamaica-infrastructure.git
Next, install required python packages:
We recommend using micromamba
to install the packages and manage installing libraries into a conda
environment, usually handling non-Python dependencies well.
Create a conda environment once (per machine/user):
micromamba create --file environment.yml
The principal goal of this repository is to produce analysis results, (damages, losses and adaptation options) that can be ingested by the ETL pipeline in irv-jamaica.
The analysis is comprised of Python scripts wrapped in
snakemake rules. Snakemake is a workflow
management system that can be used to break up complex modelling chains and
improve the reproducibility of analyses. To invoke a rule, call snakemake
followed by the file you want to produce.
To make snakemake and other software dependencies available, activate the environment we previously created.
micromamba activate jsrat
To invoke the rule (and all necessary predecessor rules) to compute commuter flows across the transport network:
snakemake --dry-run --cores 1 -- results/flow_mapping/labour_to_sectors_flow_paths.csv
Note that the --dry-run
flag asks snakemake
to report on what work (if any)
is necessary. As jobs can be long running, this is useful to check beforehand.
To actually run the rules, remove the dry run flag.
The --cores
flag indicates how many processors snakemake
will use to execute
the rules. If rules do not depend on one another and enough processors are
available, they may execute simultaneously. Also, some rules invoke scripts that
are parallelised and can make use more than one processor themselves.
See the following files within workflow/
for available rules and their input
and output files:
direct_damages.smk
losses.smk
transport_model.smk
hotspots.smk
To run any rules you will need the processed_data/
folder which contains data
that has been cleaned and can be consumed by the rules. Contact the maintainers
for access to this folder. Outputs are written to the results/
folder. These
paths can be configured by editing the config.json
file.
The Jamaica Energy Model (JEM) is a high-level power flow model of Jamaica's electricity network.
The J-SRAT web-based visualisation tool is implemented in
irv-jamaica
snail
is a supporting library, used here
for hazard-network intersections, under continuing development to support risk
analysis.
open-gira
is a supporting library and
set of workflows, used here for road network generation
This work is supported by the Coalition for Climate Resilient Investment (CCRI) project on infrastructure risk assessment and resilient investment prioritisation in Jamaica, funded by the UK Foreign, Commonwealth and Development Office (FCDO).