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.dev1.tar.gz (151.7 kB view details)

Uploaded Source

Built Distributions

threedigrid_builder-1.14.1.dev1-cp312-cp312-win_amd64.whl (618.7 kB view details)

Uploaded CPython 3.12 Windows x86-64

threedigrid_builder-1.14.1.dev1-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.dev1-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.dev1-cp311-cp311-win_amd64.whl (618.7 kB view details)

Uploaded CPython 3.11 Windows x86-64

threedigrid_builder-1.14.1.dev1-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.dev1-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.dev1-cp310-cp310-win_amd64.whl (619.7 kB view details)

Uploaded CPython 3.10 Windows x86-64

threedigrid_builder-1.14.1.dev1-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.dev1-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.dev1-cp39-cp39-win_amd64.whl (620.0 kB view details)

Uploaded CPython 3.9 Windows x86-64

threedigrid_builder-1.14.1.dev1-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.dev1-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.dev1-cp38-cp38-win_amd64.whl (617.2 kB view details)

Uploaded CPython 3.8 Windows x86-64

threedigrid_builder-1.14.1.dev1-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.dev1-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.dev1.tar.gz.

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev1.tar.gz
Algorithm Hash digest
SHA256 29849657bfc43a08b1fbbec3be167bdb22ea9cafd952af593bdf64bd8aea81c2
MD5 102fa3639b82d9f1fff3e41d6ab38ffc
BLAKE2b-256 4ca401277a75b346b2ca0a5c91876029398f99d91940f3b177c5bbff73caf91c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 dca6268b0f4c91ce7efb9ec126ef3f2bc99a01841476e55f1ecec022eea3bc8e
MD5 8bc9a3d6b2a44fde8c2bac8a11c421b2
BLAKE2b-256 bc567f9dc910cc911ec5b5c6a6d183711323b9bec0451322de9bac778f21dac4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4c1320723b52261df211349bc2154d6385b6cb633df96b20b27f14e3afa43879
MD5 286ecd90df485e2edd59d936e4189b70
BLAKE2b-256 f331a3865f6dde1702340bf1c666071a15028f4f53506464192d5273e303fe85

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev1-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 133d6719fccaaefa517595dddc4213a98e1f7a6e7128d46d5baa8b4fcf017f22
MD5 aa5cac6ddfea2afcebb341ba50202696
BLAKE2b-256 0d8a25d1199ef2d1dfc76b92557e1afa665f4880aeb2da7203371dadd90c378c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 6b7260b457665ad0849901c35a76590dcbca8daee8d8a5708d27ce3725ba8eee
MD5 d98a42efa380bebb696ba42e7707706d
BLAKE2b-256 b90f2784f1e951621c3d2f0d83a2e95e5325b43739bc0e71b93275275290fc3b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 274e9d0b3bcc5f21b7784802871c411317cc4d21ca79a96e46d903b4857cba62
MD5 203dddc4c7ba746d04bfb2edd7ac0392
BLAKE2b-256 871b95a1427441c23ee44438334c918952cec6693e8d5eb186fb29e7908bf0b1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4318b8808cf2a3ce8461bd1df618cbc43a65846d7a888cdc8fe038947d0f67f4
MD5 3d7ae312fd90345faedd50f14c42f764
BLAKE2b-256 3f9a999861e4d45712260732de8195f353a5bbb4dea704a226fb67a6a2bca017

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 d195374bfed6121cd7a4a5dad0983deaf4ba9b88684868f1ae34e70fbe70610e
MD5 5970ad3ce71ecc8c54ded8a52d9554b5
BLAKE2b-256 a6934039790384e2e9b50370fb843ea4e7ce09142bb1f8f7f5f1f87768c6fd4a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c817d352841d7738136f47768860b0688a5e8cc493d2a1bf1f18babdd7a8a627
MD5 d11255b0073fc804c0114727f67ee551
BLAKE2b-256 112fec63dc1e198b9670cef6f537abb4c3bfa032f8f6f01060abc8ee766daddf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 274703155860cb9cb13c2d650132c655aa16ee8aed41b28b5c1088899e3a838c
MD5 9d25cac44b5641ccca9e16d2738a2088
BLAKE2b-256 d327bc7a01cd9f7bb8ba8211aa574136508128668d9f66361a72e518d93ba0ca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 00d3a17d6671fc74801b2151190bb578801f37a0007997b1b7754e58a46d386e
MD5 f94e8a7e83e2b89ab0c39a8db628cd4b
BLAKE2b-256 f6b93a33c097ec1c2f095eefa9332fa964eb88f5e0e3c99bdab7d5bece456f70

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b84a21583e6dc4cbd3f5aa77da6214d36752c013eeb6ed412271ecf8569c9df9
MD5 edc21f59d77a1f9ec1a504e0718f9340
BLAKE2b-256 ebd62de94c058ffb1c4fd9095dfff3ee046d47e4fa62c425cbd63cd045064f58

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a6cd6821fdf330546d314e3ea803b4378c7b1722d755d3aa95401b3a45cccfee
MD5 701a1e0e98bb21a151d4f77e676bb5da
BLAKE2b-256 fefea8f78f556d71736e230d84bc24b897c53ecbdba285d654843d64b4af1049

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 b1ab9764c749c834a4219394b73104ac8be78f897af095185f54ddba672322c9
MD5 5878a0e6123ffab36f937a34dd823c3f
BLAKE2b-256 c34e2f81f7e085035d5f8d3c3b223e4dadaf39097aa9fedae763d5902b7e589f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 559a7fe24b284b8ce6edeb33b2e8aa14f4d38b7bccfb5288082ed155acce2a65
MD5 2388be22e7343cf4a6e029ecc63db558
BLAKE2b-256 bdc9a9c7b028f98968f6c535ee4f885a1439606b1d569c77207aa7182ce80b96

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 312a09e5ae0461e51d4f3e41a582724dec5f95e1cac22300e51a0c22fcd2284e
MD5 74048bd98b06cdb3d18c81d07efae275
BLAKE2b-256 d9ca9bc016ebc83ec539775f492cbf797b4425ab1213beeba5c82b81bef59853

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