Skip to main content

Generate a 3Di simulation grid from a model schematisation.

Project description

Github Actions status PyPI

Generate a 3Di simulation grid from a model schematisation.

Usage

This library converts a model schematisation to a 3Di simulation grid. This can be done using a single function that reads data from an SQLite and TIFF and then outputs the generated grid into a Geopackage or HDF5 file:

>>> from threedigrid_builder import make_gridadmin
>>> sqlite_path = "/path/to/model.sqlite"
>>> dem_path = "/path/to/dem.tiff"
>>> out_path = "grid.gpkg"  # or "something.h5" for HDF5 output
>>> make_gridadmin(sqlite_path, dem_path, out_path)

Alternatively, the generated grid can be output in-memory:

>>> make_gridadmin(sqlite_path, dem_path)
{'nodes': {'id': array([   1,    2,    3, ..., 7903, 7904, 7905], dtype=int32), ...}

Installation

This package is distributed as source and binary wheels on PyPI. The currently supported platforms are Windows, Linux, and OSX, all 64 bit versions only.

First install sqlite and spatialite libraries, e.g. on Ubuntu:

$ sudo apt-get install sqlite3 libsqlite3-mod-spatialite

For raster input, GDAL is required to be present. We omitted these from the dependencies because installation of GDAL depends on your platform an on your personal perference. One option is to install gdal using apt-get, and then pygdal with a matching version:

$ sudo apt-get libgdal-dev $ pip install pygdal=={your gdal version}.*

Install the threedigrid-builder:

$ pip install threedigrid-builder

For output into a file for the 3Di calculationcore, enable gridadmin output:

$ pip install threedigrid-builder[gridadmin]

For output into Geopackage for display in e.g. QGis, enable gpkg output:

$ pip install threedigrid-builder[gpkg]

The command line interface requires Typer:

$ pip install threedigrid-builder[cli]

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

threedigrid-builder-1.14.1.dev0.tar.gz (151.7 kB view details)

Uploaded Source

Built Distributions

threedigrid_builder-1.14.1.dev0-cp312-cp312-win_amd64.whl (618.8 kB view details)

Uploaded CPython 3.12 Windows x86-64

threedigrid_builder-1.14.1.dev0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

threedigrid_builder-1.14.1.dev0-cp312-cp312-macosx_10_9_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.12 macOS 10.9+ x86-64

threedigrid_builder-1.14.1.dev0-cp311-cp311-win_amd64.whl (618.7 kB view details)

Uploaded CPython 3.11 Windows x86-64

threedigrid_builder-1.14.1.dev0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

threedigrid_builder-1.14.1.dev0-cp311-cp311-macosx_10_9_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

threedigrid_builder-1.14.1.dev0-cp310-cp310-win_amd64.whl (619.7 kB view details)

Uploaded CPython 3.10 Windows x86-64

threedigrid_builder-1.14.1.dev0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

threedigrid_builder-1.14.1.dev0-cp310-cp310-macosx_10_9_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

threedigrid_builder-1.14.1.dev0-cp39-cp39-win_amd64.whl (620.0 kB view details)

Uploaded CPython 3.9 Windows x86-64

threedigrid_builder-1.14.1.dev0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

threedigrid_builder-1.14.1.dev0-cp39-cp39-macosx_10_9_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

threedigrid_builder-1.14.1.dev0-cp38-cp38-win_amd64.whl (617.2 kB view details)

Uploaded CPython 3.8 Windows x86-64

threedigrid_builder-1.14.1.dev0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

threedigrid_builder-1.14.1.dev0-cp38-cp38-macosx_10_9_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

File details

Details for the file threedigrid-builder-1.14.1.dev0.tar.gz.

File metadata

File hashes

Hashes for threedigrid-builder-1.14.1.dev0.tar.gz
Algorithm Hash digest
SHA256 a73f9165cbea99d55b0c8e25d79f0d5355bc16d8bd87923a39718a506d7f12fd
MD5 f9d4eb082cd071e9315d4b8396835784
BLAKE2b-256 7e0cb24d8d0a6bff960c1c0f22137ae5b9246a16e1a6ef9eb22f20b538bb954d

See more details on using hashes here.

File details

Details for the file threedigrid_builder-1.14.1.dev0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 721cf9b8a7aa094ba886e51222724eed2664a7533e911ad67e4e1f76ec0a3ccd
MD5 3084203e42ff9898c61a4fe660408eb8
BLAKE2b-256 961f58ebf0ee9dea903ecb62832070b9355fa7de9c144697b6156176578c1c05

See more details on using hashes here.

File details

Details for the file threedigrid_builder-1.14.1.dev0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1f1ca7d9708c9c2871618cdde3dd48d4bfee54820d3a42e80c435e60a6ffd61a
MD5 998061aa72416a035fc5f56813d6d509
BLAKE2b-256 eabc2d783c5140c47c2ab476c6a30a0f7e96d6ce32b61f14edbab0cfde82ad04

See more details on using hashes here.

File details

Details for the file threedigrid_builder-1.14.1.dev0-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev0-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d6af39032ca21f01c97487531e626ef94a76d2c0866645a4c46e395f11e6e988
MD5 f63c13354f0f48eb9c571347c178bda7
BLAKE2b-256 c1a31f6d059d186302eb767874a90617476e0abab9d21ea8b2f4b70447757f86

See more details on using hashes here.

File details

Details for the file threedigrid_builder-1.14.1.dev0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a5aebc385aa1939a04e1161678863d573e2de56803eb35034a324c5e599cb598
MD5 cea41f36885876029c5f9824809b58b9
BLAKE2b-256 c3fafb436db0c36146b7484f8fef0c23ea9498c7446dcf76aeef04a6165695f7

See more details on using hashes here.

File details

Details for the file threedigrid_builder-1.14.1.dev0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a42dad9477281e565826e704dc90150a0586fbd55b2e66e3401303153ee1c7e1
MD5 8dd6f241667517ea3ee4a855f8066040
BLAKE2b-256 93a9cc9b7ad7f912508ee662ad2a0ea46c7a5d31dce24a428d68d9a6769bcfed

See more details on using hashes here.

File details

Details for the file threedigrid_builder-1.14.1.dev0-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e3be93ddb442371e75591e2286d24c71071c762c752d11a13ea19791e23e391b
MD5 343fd294c3e87d1f6307c8e8642ca0c1
BLAKE2b-256 a7addcef4a57e20b4990ff67e78a3948fe65127b5606c433cffd25998e181c20

See more details on using hashes here.

File details

Details for the file threedigrid_builder-1.14.1.dev0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 29914df3a20109b7b4a207ec5c8357136c7940048f5f3e32d1b974988b0a1dbf
MD5 3711116283d1cfaeeba54a02761a4119
BLAKE2b-256 d9b604e5287e5c5a353956b6bbc3c4c0d59fa8f219fb136f57e3db2095e86955

See more details on using hashes here.

File details

Details for the file threedigrid_builder-1.14.1.dev0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6780ea543ed7d0e2bf1832723934c0b9d09bd5bcdac56f8e5668b456f9ba7d69
MD5 4aa8cf089a109bb535e822badc910e91
BLAKE2b-256 97968876d68c052bded954d56bfa5045743e13246e23eeb6118a95ff434e0a2d

See more details on using hashes here.

File details

Details for the file threedigrid_builder-1.14.1.dev0-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 8def657cf07d604251ad4a12e40a7e8df090f209f44791b414e95d9fd2826629
MD5 0004be24030d9d8c4da20cea9cebc97f
BLAKE2b-256 181c98bff81c9b490f94ebbc84cb28151a8696ee3f6959baf8efa492362d52b5

See more details on using hashes here.

File details

Details for the file threedigrid_builder-1.14.1.dev0-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 4c4a94db2ebaefd6f062be8d93380ccdae6bfe81a64453bff7063e97eb4840dc
MD5 9ec01f2d67ece7b5cfb6ff0ba95abd8e
BLAKE2b-256 69e9beb966986cb924d189028b96e62cdebcad42462343723ecebcf65a2ee59e

See more details on using hashes here.

File details

Details for the file threedigrid_builder-1.14.1.dev0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bd33ac4ae6ed390aef58dfa5f39d821f4853fa81edcf0440086c59ffac7c130b
MD5 f94d71765fa83d62e47271baaee0ead1
BLAKE2b-256 2f0c1938019c885cc6177227feb46f290f39e39e44534a5210db8da927448b1d

See more details on using hashes here.

File details

Details for the file threedigrid_builder-1.14.1.dev0-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a11b9b96bbdc9bf8ed82f9c09d5196d8209a5b5fa5baa9b8efa69976b85e926e
MD5 3eea93d91f0c0647257e8ed7591c64ca
BLAKE2b-256 1ddb9f5eae55a3034897a6c36a9f5f0b2505d7df43581042b288b9aa5eb41255

See more details on using hashes here.

File details

Details for the file threedigrid_builder-1.14.1.dev0-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 0df39ef316eb105a69d9ea0261cb86dcd27733f66266c075e0b83102b8dc6c26
MD5 43a323e35c658829b90a4140c304a0fe
BLAKE2b-256 40df1d2b0e4d8214855bf42ab4b927dab635e47b3fca7b5b5b3b0446efca923b

See more details on using hashes here.

File details

Details for the file threedigrid_builder-1.14.1.dev0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ec22206c6644bbcf663b9e0657e6f5272751545c9fa1bfabcf07f603aea4fbed
MD5 345ded4f7575c6c94368378d8731b6d7
BLAKE2b-256 5fbf645540763ce77ab63bd69098fb6e3e6e86a35aa650c54264a959103897a7

See more details on using hashes here.

File details

Details for the file threedigrid_builder-1.14.1.dev0-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d83a69c611eb605a95d6238231a97866d53626e2da3e0a3e9d1d590060d0f5c5
MD5 1dab39039f3758ac7a392a749fe9944e
BLAKE2b-256 ee31ff9c30ed22490c9411a7cea1e7a886c7ff73df0acc8132c4e12678af41bd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page