The spatial networks impact assessment library
Project description
This code is under early development
🤔 What is this?
This is a Python package to help with analysis of the potential impacts of climate hazards and other perils on infrastructure networks.
Installation
Install using pip:
pip install nismod-snail
This should bring all dependencies with it. If any of these cause difficulties, try using a conda environment:
conda env create -n snail_env \
python=3.8 geopandas shapely rasterio python-igraph
conda activate snail_env
pip install nismod-snail
If all worked okay, you should be able to run python and import snail:
$ python
>>> import snail
>>> help(snail)
Help on package snail:
NAME
snail - snail - the spatial networks impact assessment library
Development
Clone this repository using GitHub Desktop or on the command line:
git clone git@github.com:nismod/snail.git
Change directory into the root of the project:
cd snail
To create and activate a conda environment with snail's dependencies installed:
conda env create -f .environment.yml
conda activate snail-dev
Run this to install the source code as a package:
pip install .
If you're working on snail itself, install it as "editable" along with test and development packages:
pip install -e .[dev]
Run tests using pytest and pytest-cov to check coverage:
pytest --cov=snail --cov-report=term-missing
Run a formatter (black) to fix code formatting:
black src/snail
When working on the tutorial notebooks, it is recommended to install and configure nbstripout so data and outputs are not committed in the notebook files:
nbstripout --install
C++ library
The C++ library in src/cpp
contains the core routines to find intersections of
lines with raster grids.
Before working on the C++ library, fetch source code for Catch2 unit testing library (this is included as a git submodule):
git submodule update --init --recursive
Build the library and run tests:
cmake -Bbuild .
cmake --build build/
./build/run_tests
Run code style auto-formatting:
clang-format -i src/cpp/*.hpp
Run lints and checks:
clang-tidy --checks 'cppcoreguidelines-*' src/cpp/*.hpp
This may need some includes for pybind11
- which will vary depending on your
python installation. For example, with python via miniconda:
clang-tidy --checks 'cppcoreguidelines-*' src/cpp/* -- \
-I/home/username/miniconda3/include/python3.7m/ \
-I./pybind11/include/
Integration of C++ and Python using pybind11
The snail.core.intersections
module is built using pybind11
with
setuptools
src/cpp/intersections.cpp
defines the module interface using thePYBIND11_MODULE
macropyproject.toml
defines the build requirements for snail, which includes pybind11, wheel and setuptoolssetup.py
defines thePybind11Extension
module to build - both the C++ files to compile, and the location of the built module within the python package
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for nismod_snail-0.2.1-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 968322459af05c1332553ce7fc4e1107cb799437e165f90e3e4731437c5f017a |
|
MD5 | 7c412c8a2daafdb52724b2cad34c0c32 |
|
BLAKE2b-256 | 95cea7c5ea8093b2d35c3904db51689b246cccf3b54974c37c9c5b8e4e93b143 |
Hashes for nismod_snail-0.2.1-pp37-pypy37_pp73-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a0a1d1fe6c1b4fccd52abc632029c8534454e1bddbfa9ab1bc2565637abc5be |
|
MD5 | c28c4efa9eefa88b7819b20bacb9fc95 |
|
BLAKE2b-256 | 9c9d9caf3219e1f618e80535f965005ee1ee618029f63c035a12c1fee8ae22c1 |
Hashes for nismod_snail-0.2.1-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9710f7c750e608e1f42b24a04ed1d200562b79a1919c8ed0584c53231ae6170d |
|
MD5 | 057ab5445c77506181ecb87fdbd738c9 |
|
BLAKE2b-256 | 187757cdfce3ab0f81dcb4952cd49afb9b35ea6e25111b433fdd4e9864b7438e |
Hashes for nismod_snail-0.2.1-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c816892b14cd030da7d62fb6156684253c48aa17833036dafd2ad9ccc78962d2 |
|
MD5 | 51fb15ffb5cd9029c82939096d0faef7 |
|
BLAKE2b-256 | 0936b4749671cd6bf625c987499416131be608a2b30d46929942957047354ba8 |
Hashes for nismod_snail-0.2.1-cp310-cp310-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44c00427df2565b7e924ec5d73072931bcbeb595d7f275b77227bc9df20d820c |
|
MD5 | 90b98df9a7d9841f74d745a1f5dec5bd |
|
BLAKE2b-256 | 47c71cd4c72bfb43b7176e7dce9f572b9ee98f35dd0baf854603d0f49c48fb3e |
Hashes for nismod_snail-0.2.1-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3f0656b3d7c4620da8acd9089ac982c04eeaa94990b3b5898871787716cbe0c |
|
MD5 | f70c458e5514074ba077d266c2306455 |
|
BLAKE2b-256 | 4e72ca50a122af0a655adfb14eeb4c833af7d4b557705adeab56a5d42bbb0e3a |
Hashes for nismod_snail-0.2.1-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51ad2a3691d7f062eff2c555220cf6392ed4a4012bd1477e54f668b7b34e6c8b |
|
MD5 | 2002158c2875cdcb5ea97a560dfd1ab0 |
|
BLAKE2b-256 | 4dbd6c36227dfcf8cff5d4a9217c97f6cb77912f8e8f12aad3d6daa42252489b |
Hashes for nismod_snail-0.2.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fcc59eeb8ab196963e78bfc4a73c2c0a20e37b0bf56a2a53812e571a51aaa8b4 |
|
MD5 | b28637a7551ddef5c3477f7a0659aed9 |
|
BLAKE2b-256 | 395200263bfc3e7a6016245067230ef42bfe9a9ca137d66d40debe3a5915d221 |
Hashes for nismod_snail-0.2.1-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99533ff63131ce52b9c57af421452dc6cdb1783f9b1c42e6da1a9c53d97cba7f |
|
MD5 | 0a81f99487622ca018ccc221d4c20fee |
|
BLAKE2b-256 | b5a1555a5d2ed7bce74fa9f4cf77533f5bd4ec6fd005b11651376d9e8ec7f4cd |
Hashes for nismod_snail-0.2.1-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 520c4c9a239ab2d72096028cae8029d7a07b9ae6e5a196c695082a5ac939ddea |
|
MD5 | 59c9496e843ff38ebc8082a3efa4a45e |
|
BLAKE2b-256 | 731413050dd0b51288e8372928673e06af0d7fca841dd0b2cddc898afa036317 |
Hashes for nismod_snail-0.2.1-cp39-cp39-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8691d929a9a8f45cd08dcf9ab2ea1841fe5d5afad64385c953a10117bbfc82ea |
|
MD5 | 15c6709485251b04c7a2cce357969c56 |
|
BLAKE2b-256 | 2ee88d9be36e27d326c69dfae84c6c2b12dd78a98a2082946bca358a95ce1fe9 |
Hashes for nismod_snail-0.2.1-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 695f04612209ee2774495ffb0558c1d50f43ba1f72593bb8159e566a28e9ffbd |
|
MD5 | ee7d3e346c41b2a83470be5c2e72b98e |
|
BLAKE2b-256 | 179c2c40e9a1b9c39c07df89b80063e05e3d492a423daeb35ac77e6763e5616c |
Hashes for nismod_snail-0.2.1-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7154693c566d33f3a4f74dfe732ed04355fa8d1465819f978400539abf1a1f90 |
|
MD5 | 06e2b9164cabb0850c96431816048e28 |
|
BLAKE2b-256 | 633d8dddda66109c0a017f954a97ab9dc1b07518ea0d0b9802e446e082bc51f9 |
Hashes for nismod_snail-0.2.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1f8368766c3369c248e5fdb1f2231e30ba4dc2af177edf78a91f50e8544db14 |
|
MD5 | 465dacafa370d105f7f67edaacbbfc2a |
|
BLAKE2b-256 | bf7b561c7278035f10e17ad34b76c5b31f560e0f057db1d63e2a1543b97e22c8 |
Hashes for nismod_snail-0.2.1-cp39-cp39-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a89bc8ecefc6b1ac4d69cfda378e28f46d6ece77dce14623498d532bb4126466 |
|
MD5 | c705d3220d1a884fe4656aeb499ee480 |
|
BLAKE2b-256 | 9368d02d9d64db435249a0d24ad7d54a6a9bdfe0b85186dc2438c89d40ae70a8 |
Hashes for nismod_snail-0.2.1-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d959cae30eed475a333c182a8e4cea12bc87cca2a5dfd9e045a94d1ae39ba7dd |
|
MD5 | 9719ed20435638e7af4d1ddbf6aeec0c |
|
BLAKE2b-256 | dbca4b29e9ad4e81a3cb86b4d7cde974c050dd8c6822ecda3ff4d0dc85b635b9 |
Hashes for nismod_snail-0.2.1-cp38-cp38-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dfc361bf539ea57b11a50b56db109e9140685195bf646ea260e13a1eccff0584 |
|
MD5 | c0dc0fd067bae4d2fa4bc23991c9a6a8 |
|
BLAKE2b-256 | bdfa195e1fd5069dccb0a1b25687d9f88733b74be1029ce45736bd6b387884ce |
Hashes for nismod_snail-0.2.1-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f1d6cb8dc372dc042c573f86a4a7557d94ac0f41c3e44b00bd22c3a78b3301e |
|
MD5 | c8cf56dd525799481d5ec564054c0358 |
|
BLAKE2b-256 | 5cee7ea768315b85469e93fe47ebe41f2330e58e9fb6bbee6ca88088564ed1d8 |
Hashes for nismod_snail-0.2.1-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3a86e214fbe61995233390475eacf81353f38dd36d105e665aa64d2a3e1240e |
|
MD5 | e29640b01bf964ea8dcf1fd66b685246 |
|
BLAKE2b-256 | e762ff6adc20eb19ca9b2e79c30e4201eb606bae14d732da7e1a1fb3cc1b50ed |
Hashes for nismod_snail-0.2.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9a4da4b3aad54faab0812d56290789ef7c2449b94cc16061652054504ec8ff9 |
|
MD5 | 596752b075dee2db713e214241b66455 |
|
BLAKE2b-256 | 44cf44ab0f2e3f0186af610ebabf4a5aa1edf302bf62f0cc916e212df1d9a230 |
Hashes for nismod_snail-0.2.1-cp38-cp38-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af57a734f8c237302accd3dcf45e1f0144f591febb88e49528ff875ffd63eea6 |
|
MD5 | c9dad5c532cfbe71011e9f7ad64b4df7 |
|
BLAKE2b-256 | f70e1714c5f8badd7dae5a7b559bcc9d2f2557506fb45751cdd3a7cef87c55db |
Hashes for nismod_snail-0.2.1-cp37-cp37m-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 195b803cc9485e3aaa7881ca7fad5d9a468781045de9a71eebc72ba6fd8f97b6 |
|
MD5 | 3d805c6e3d7ab8a9d9a1031dea3b1cf7 |
|
BLAKE2b-256 | cd0b300425731ee003257861341d62301d594767b32323cc54cc38f62c88a949 |
Hashes for nismod_snail-0.2.1-cp37-cp37m-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de73aa7c0bbd945b7201b7316fca6b52a9131b9707b127b64961fdf4bc6b61d2 |
|
MD5 | a427f47a631fb066543e6c04296074ad |
|
BLAKE2b-256 | d5f6b30cf41b49ea5b1452b38876f99487fb31f6c8928e2ec7550828d35a4ec5 |
Hashes for nismod_snail-0.2.1-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d382af479889f8ec0c55ec734ff5ed53348efd2247a9884256f85f47df2f8df |
|
MD5 | 10350d87b6a0afce96403b8278c3f8dc |
|
BLAKE2b-256 | 85b19c6d890e6828a4c403876285d9691de91616bffd2cef0fb1b9ad78757180 |
Hashes for nismod_snail-0.2.1-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d32f50a885441138623c7b932e619bf966757956310c940ce1229d9e1e6d2378 |
|
MD5 | 40a5766e47da602a2c331ee617200cad |
|
BLAKE2b-256 | c7c5b1d6250ad4279c9752139149acebb8e69aa3e777c201d5b5139e5bc2885a |
Hashes for nismod_snail-0.2.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f66d4ccf331ad770a505917402334ea4d7bf7bc813fd5e748fc6165c1a5536f4 |
|
MD5 | 5ca299bd29b3b0c9607fe27768936718 |
|
BLAKE2b-256 | a953b40ee6fd3a69df4246f8d17711d212daf429dccfeff9da964fe0592816cb |
Hashes for nismod_snail-0.2.1-cp36-cp36m-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f48e3381249886187b04337aab0f4c7b80694eb004f9418c61165e6129be55f6 |
|
MD5 | a64c3e6a8c2d0cc81e27da1f4b7b4256 |
|
BLAKE2b-256 | 3130253bfd79693db9a0432cb65bf3e55d12d3932c885d012bf54cfe30bace5f |
Hashes for nismod_snail-0.2.1-cp36-cp36m-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8ce2d054688b766054958313d92da4ad034a6c70cf158a951773a0c0a9cb4a3 |
|
MD5 | aa06e124a256de4d8b5cab65d3ddfb4d |
|
BLAKE2b-256 | d85fe393f8ec9a3cc46e9949b4d98a6147b3b7472e8e7eb01579a7deda4d2a60 |
Hashes for nismod_snail-0.2.1-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4803b1be29e91e23dcec5541b23af861ab755c17e79b3a693455e1a7bf94dd7 |
|
MD5 | 7b7b659bc6db1f7d18373706cc80cc71 |
|
BLAKE2b-256 | 118138a7a05d8d6ca4b6bb4656229a543f375061a9616e60d97c4b364cea042f |
Hashes for nismod_snail-0.2.1-cp36-cp36m-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c1c97d4aa39a1e6e776421a01d38ba4995d36fdd8e9c2e3416fde4434336afe |
|
MD5 | 305c8f7a7ba4d5ba7b324fab82953b34 |
|
BLAKE2b-256 | a524592f31ecaa58ef36511b8e620340919f9353972cd30fad9e15489551879d |
Hashes for nismod_snail-0.2.1-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2244be6532c85084af09e2f81eff23c83cc2d2af70c634ea595ee9e5e47ac827 |
|
MD5 | 02d845dbffe540ed604a0e7be45d9fff |
|
BLAKE2b-256 | fcba44b61a507ce8767e3ed155ddc8cf8c9c2721e1254cd72a8fa885c62a46f1 |