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.15.1.dev0.tar.gz (151.4 kB view details)

Uploaded Source

Built Distributions

threedigrid_builder-1.15.1.dev0-cp312-cp312-win_amd64.whl (618.4 kB view details)

Uploaded CPython 3.12 Windows x86-64

threedigrid_builder-1.15.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.15.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.15.1.dev0-cp311-cp311-win_amd64.whl (618.4 kB view details)

Uploaded CPython 3.11 Windows x86-64

threedigrid_builder-1.15.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.15.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.15.1.dev0-cp310-cp310-win_amd64.whl (619.4 kB view details)

Uploaded CPython 3.10 Windows x86-64

threedigrid_builder-1.15.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.15.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.15.1.dev0-cp39-cp39-win_amd64.whl (619.7 kB view details)

Uploaded CPython 3.9 Windows x86-64

threedigrid_builder-1.15.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.15.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.15.1.dev0-cp38-cp38-win_amd64.whl (616.9 kB view details)

Uploaded CPython 3.8 Windows x86-64

threedigrid_builder-1.15.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.15.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.15.1.dev0.tar.gz.

File metadata

File hashes

Hashes for threedigrid_builder-1.15.1.dev0.tar.gz
Algorithm Hash digest
SHA256 49306496f180b369b943f6edbcad4ecf1bd5e382f2b5dd32d69b317e1619aa9d
MD5 9af78f4312a7071c18768f06169a9059
BLAKE2b-256 c83267e40f82fa822f290f38ccbb292e4120e16cb72287f12df76471ef22548d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.15.1.dev0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 448f176f1beeaaad647b013bb6003d5f66de6350352204f1ee5a10fa98566945
MD5 9848e3471ce413aec92cc43fb51d6bf8
BLAKE2b-256 e97b62a2f6141a66168b99e8a50c278dd19db454bd5803d852ff0c7519db19f2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.15.1.dev0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5064e8ff265522014c3115c1d91bdbcb8a35dff26cfed80a075790491455ff18
MD5 98870d57ec926844277d26cd17ebf452
BLAKE2b-256 5d038ea86c5f5ba980c68ec43fcb15dcc034dcf7d15229d1dea6c00bb33a7592

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.15.1.dev0-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 40798379fbdd8b5f9c9c299844a388fb7c26f761dfbce12bb9275dde3e70e867
MD5 f708501c1eddf366fdf368494e4fa3c3
BLAKE2b-256 588fa30edbb786a68ebad7702789a2a4a2e99dce2e3181711cf0bd710eb9ef33

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.15.1.dev0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 01d4d9b5261df2f230f7a1e8175f36facee4dddda9e70a8b0fdf8d9e9cbd1b33
MD5 0e36fee0f0efaff4ba755b83044a943d
BLAKE2b-256 ac22241eb00dc112cbb5cbbb59a60e8aadb9c244202694face3e922e426fe204

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.15.1.dev0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c7378e2c914fb390aa3767c70ce83eace7113a5458d2bd79210e12d26eb47d2f
MD5 ffe0477fa2fa2b05560131c4ea94d91f
BLAKE2b-256 ff112c1eedd69c9cb41bdca2494e37842e317f4bf2348774f8e23bcbdee4e46a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.15.1.dev0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b1c2d2e5c5d590968e308f27e8072b3fd8272030afd2b09b14152f50633aaf33
MD5 fe61dd7ab74832498f1060eb30e9b384
BLAKE2b-256 77ea1b88d1cc6b910131e0e8960f49560138ce444e4bbadc27136ccbe8ae355e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.15.1.dev0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 3f1073cfe1e0987c3dde48feb33706c456567e7ce8d7dfea22c07375899874b6
MD5 837c0a9602ca55ee9d2600e4b87fda06
BLAKE2b-256 bf59ada7aeead1c38ff5df926eaa795097b6cc4e6cf6503af5904ffa6924b857

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.15.1.dev0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 391eeac85fca9e893ae44a901b85c185abe24aa62e952cc074a69f7800239cc2
MD5 3e6f708ed8b8352f406c0929bc7df2d7
BLAKE2b-256 94d1d3753b87cf9e5535a7d8b11004aac6d63d245d0068e80babd66a45a0d40c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.15.1.dev0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b50e33535beabc45a98fe801674c0daa83e73d97f1ad4c4f0e7042fc3ae6f0bd
MD5 1c6d0f62e3512e545dcd0d4aec95b1b8
BLAKE2b-256 7742c96cf5a41c67078c51885ad92f15c62a6eaae1369a3e820084a08acc0216

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.15.1.dev0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 d60abbfee1579203dc338f87fe9f4d93d444b79524355fbff4d37239a905be48
MD5 d537fe053d3d004156278e9f53325cd9
BLAKE2b-256 1381206fe0853ff106605f27c0f6b8fb305e46a9f8cc58296adb8353e39a51c1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.15.1.dev0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2542e7d1cf2d283825ebd966332110d7f9bafbd3ea250d0ca0de45fe24ee81fc
MD5 53cec4c22b688c661662eeeda1542a8c
BLAKE2b-256 930fc2e7af39f03e0a85108ae4c35cc0773a2ce65d43080046f6a74a9ab92329

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.15.1.dev0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f2cb5e0ba6812d8b3f3b2d49f6a85ec5f86c52d446c2c56164d65c7f3d54e5e9
MD5 ce1f176915f401c5cacef7db1a39341c
BLAKE2b-256 c9e76d0e8d3771e09735bf5ee3cd5b9a035847ba66d70c482011bb96f600f7a2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.15.1.dev0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 4c4ba30aeed8f439f3d533ba7505bd9dc9260c56977d102adf729578c212aaf7
MD5 c4e55b4571d7cff6278ef32a5c867f57
BLAKE2b-256 f9df1a856c0e1dc3405f2c2fcb6a5a4689f1b9e67debb245fef2f6c4968354f5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.15.1.dev0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 30a90e655a4242ce390c92cdcc1e36f9548271dc81ba15ba4d298de35bb6703e
MD5 99a28d491080c671944d02c58084659a
BLAKE2b-256 7b49d9adf68f82ca27e87c73be4f18009078921fe956123023797ae0b554debd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.15.1.dev0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a2e1b6874d086e2333257d8c377f266111a35795ea203d555cfa8e1b1838e0e8
MD5 50b652f3e0d0837ac4ff4ddaf7dc73c4
BLAKE2b-256 ccc3f67ac368b3046cb34b72742b8e774c31786702c98ca17e46e20f58b0318a

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