open-gira

Open-data Global Infrastructure Risk/Resilience Analysis

https://github.com/nismod/open-gira

Science Score: 59.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
    7 of 9 committers (77.8%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.9%) to scientific vocabulary
Last synced: 6 months ago · JSON representation

Repository

Open-data Global Infrastructure Risk/Resilience Analysis

Basic Info
Statistics
  • Stars: 15
  • Watchers: 4
  • Forks: 7
  • Open Issues: 30
  • Releases: 6
Created over 4 years ago · Last pushed 7 months ago
Metadata Files
Readme License

README.md

Open Global Infrastructure Risk/Resilience Analysis

mdBook Documentation pyTest snakemake workflow Zenodo DOI

Introduction

This open-source snakemake workflow can be used to analyse environmental risks to infrastructure networks using global open data. It is a work in progress.

Goals:

  • Automated pipeline for reproducible analysis anywhere in the world
  • Maps per-country and of larger areas
  • Charts/stats of exposure per admin region, per hazard type, scenario, epoch
  • Consider transport, electricity, water, communications systems
  • Consider river flooding, storm surge coastal flooding, tropical cyclones
  • Estimate direct damages to physical networks
  • Estimate indirect effects of disruption - people affected, economic activity disrupted

Non-goals:

  • Using closed data, which may be appropriate for other projects or use-cases
  • Detailed operational/engineering level simulation
  • Long-term planning

Installation

Install open-gira by cloning the repository:

bash git clone https://github.com/nismod/open-gira.git

The repository comes with a environment.yml file describing the conda and PyPI packages required to run open-gira. The open-gira developers recommend using either micromamba or mamba to install and manage these conda packages.

Having installed one of the suggested package managers, to create the open-gira conda environment:

bash micromamba create -f environment.yml -y

MacOS

On MacOS with Apple silicon chips, the osmium and osmium-tool packages are not yet available for the osx-arm64 conda subdir, which is what Macs with silicon chips use by default.

Explicitly set it to osx-64 when creating the repo with mamba or conda:

mamba env create -f environment.yml --subdir osx-64

Or build osmium and osmium-tool from source.

And to activate the environment:

bash micromamba activate open-gira

Utilities

wget

Some rules use the wget utility to download files.

On Linux or MacOS, you may already have the wget utility available. If not, it should be possible to install with your usual package manager (e.g. apt, MacPorts, brew), or else using micromamba:

bash micromamba install wget

On Windows, you may have it already if you have a MinGW or Cygwin installation. If not, you can access binaries at eternallybored.org. Download the standalone exe and place it for example in C:\Users\username\bin or somewhere on your PATH.

exactextract

exactextract is used for zonal statistics in the tropical cyclones / electricity grid analysis. It is not available via the conda package management ecosystem and so must be installed separately. Please see exactextract installation instructions.

imagemagick

imagemagick is used for approximate comparison of image files produced by the automated tests. Imagemagick is available for download and installation. On Linux, it is likely available through your package manager. On Mac, run brew install imagemagick.

You are now ready to request result files, triggering analysis jobs in the process.

Note that all subsequent commands given in the documentation assume that the open-gira environment is already activated.

Tests

Workflow steps are tested using small sample datasets.

To run the tests:

bash python -m pytest tests

Usage

open-gira is comprised of a set of snakemake rules which call scripts and library code to request data, process it and produce results.

The key idea of snakemake is similar to make in that the workflow is determined from the end (the files users want) to the beginning (the files users have, if any) by applying general rules with pattern matching on file and folder names.

A example invocation looks like:

bash snakemake --cores 2 -- results/wales-latest_filter-road-primary/edges.gpq

Here, we ask snakemake to use up to 2 CPUs to produce a target file, in this case, the edges of the Welsh road network. snakemake pattern matches wales-latest as the OSM dataset name and road-primary as the network type we want to filter for, picking up the filter expressions as defined in config/osm_filters/road-primary.txt.

To check what work we're going to request before commencing, use the -n flag:

bash snakemake -n --cores 2 -- results/wales-latest_filter-road-primary/edges.gpq

This will explain which rules will be required to run to produce the target file. It may be helpful to visualise which rules are expected to run, too.

The workflow configuration details are in config/config.yml. You can edit this to set the target OSM infrastructure datasets, number of spatial slices, and hazard datasets.

See the documentation and config/README.md for more details on usage in general and on configuration.

Documentation

Documentation is written using the mdbook format, using markdown files in the ./docs directory.

Follow the installation instructions to get the mdbook command-line tool.

To build the docs locally:

bash cd docs mdbook build open book/index.html

Or run mdbook serve to run a server and rebuild the docs as you make changes.

Related projects

Two libraries have been developed in tandem with open-gira and provide some key functionality.

snail

The open-source Python library snail is used for vector-raster intersection, e.g. identifying which road segments might be affected by a set of flood map hazard rasters.

snkit

The snkit library is used for network cleaning and assembly.

Acknowledgments

This research received funding from the FCDO Climate Compatible Growth Programme. The views expressed here do not necessarily reflect the UK government's official policies.

This research has also been supported by funding from: the World Bank Group; the UK Natural Environment Research Council (NERC) through the UK Centre for Greening Finance and Investment (CGFI); and Global Center on Adaptation (GCA).

Owner

  • Name: National Infrastructure Systems Model
  • Login: nismod
  • Kind: organization
  • Location: United Kingdom

GitHub Events

Total
  • Create event: 10
  • Release event: 2
  • Issues event: 10
  • Watch event: 3
  • Delete event: 7
  • Issue comment event: 23
  • Push event: 50
  • Pull request review comment event: 5
  • Pull request review event: 4
  • Pull request event: 13
  • Fork event: 2
Last Year
  • Create event: 10
  • Release event: 2
  • Issues event: 10
  • Watch event: 3
  • Delete event: 7
  • Issue comment event: 23
  • Push event: 50
  • Pull request review comment event: 5
  • Pull request review event: 4
  • Pull request event: 13
  • Fork event: 2

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 1,270
  • Total Committers: 9
  • Avg Commits per committer: 141.111
  • Development Distribution Score (DDS): 0.49
Past Year
  • Commits: 107
  • Committers: 3
  • Avg Commits per committer: 35.667
  • Development Distribution Score (DDS): 0.159
Top Committers
Name Email Commits
Fred Thomas f****s@o****k 648
Tom Russell t****l@o****k 224
Fred Thomas f****s@o****k 153
Thibault Lestang t****g@c****k 119
maxrob27 m****n@g****m 94
mjaquiery m****y@p****k 21
Matt Jaquiery m****y@c****k 7
cenv0972 c****2@l****k 2
Fred Thomas f****s@t****g 2
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 90
  • Total pull requests: 116
  • Average time to close issues: 4 months
  • Average time to close pull requests: 7 days
  • Total issue authors: 8
  • Total pull request authors: 6
  • Average comments per issue: 0.79
  • Average comments per pull request: 0.46
  • Merged pull requests: 111
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 7
  • Pull requests: 14
  • Average time to close issues: 4 days
  • Average time to close pull requests: 7 days
  • Issue authors: 3
  • Pull request authors: 3
  • Average comments per issue: 1.43
  • Average comments per pull request: 0.5
  • Merged pull requests: 13
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • tomalrussell (34)
  • thomas-fred (32)
  • mjaquiery (12)
  • itrcrisks (4)
  • tlestang (3)
  • alisonpeard (3)
  • ischlo (1)
  • jacobbieker (1)
Pull Request Authors
  • thomas-fred (68)
  • tomalrussell (23)
  • tlestang (16)
  • mjaquiery (10)
  • maxrob27 (5)
  • albert8v (2)
Top Labels
Issue Labels
enhancement (7) documentation (3) bug (2) good first issue (1)
Pull Request Labels
enhancement (6) documentation (4) bug (2)

Packages

  • Total packages: 1
  • Total downloads: unknown
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 6
proxy.golang.org: github.com/nismod/open-gira
  • Versions: 6
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.4%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 6 months ago

Dependencies

.github/workflows/docs.yml actions
  • actions/checkout v2 composite
.github/workflows/test.yml actions
  • actions/checkout v2 composite
  • mamba-org/provision-with-micromamba main composite
Dockerfile docker
  • osgeo/proj latest build
docker-compose.yml docker
  • peaceiris/mdbook v0.4.15
pyproject.toml pypi
environment.yml pypi
  • nismod-snail ==0.5.2
  • osmium ==3.2.0
  • snkit ==1.8.1
  • zenodo_get >=1.5.1