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

Uploaded Source

Built Distributions

threedigrid_builder-1.17.0-cp312-cp312-win_amd64.whl (624.6 kB view details)

Uploaded CPython 3.12 Windows x86-64

threedigrid_builder-1.17.0-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.17.0-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.17.0-cp311-cp311-win_amd64.whl (624.6 kB view details)

Uploaded CPython 3.11 Windows x86-64

threedigrid_builder-1.17.0-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.17.0-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.17.0-cp310-cp310-win_amd64.whl (626.1 kB view details)

Uploaded CPython 3.10 Windows x86-64

threedigrid_builder-1.17.0-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.17.0-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.17.0-cp39-cp39-win_amd64.whl (626.4 kB view details)

Uploaded CPython 3.9 Windows x86-64

threedigrid_builder-1.17.0-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.17.0-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.17.0-cp38-cp38-win_amd64.whl (623.2 kB view details)

Uploaded CPython 3.8 Windows x86-64

threedigrid_builder-1.17.0-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.17.0-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.17.0.tar.gz.

File metadata

  • Download URL: threedigrid_builder-1.17.0.tar.gz
  • Upload date:
  • Size: 154.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for threedigrid_builder-1.17.0.tar.gz
Algorithm Hash digest
SHA256 8ef7c1ce759fb6b795a3c190741d40ba009a84ab950b6161d8886bd1403d94a9
MD5 b19c19843a4b0c975bfcfaedee123430
BLAKE2b-256 5d1f92a348da607e36ee4ac4cb64bbe54f68bd5c688148d0ee9e8730a2376978

See more details on using hashes here.

File details

Details for the file threedigrid_builder-1.17.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for threedigrid_builder-1.17.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 159ad9a21c04c1f0dcdd7006cfde5f6764304a9e0f122c1b940a4f0765437f5a
MD5 0fb1157bff3b22845971337d4d5ee7b9
BLAKE2b-256 da336b01174e2c044947265eb7315d021f82cecde2a7d0f72de07c590fb8d798

See more details on using hashes here.

File details

Details for the file threedigrid_builder-1.17.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for threedigrid_builder-1.17.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 692adf9c7f7f7e3e234c92cdc54ba3cc76882c3ab6736f44d22e59759583f687
MD5 8af871629f0c3434c3298d420a6e5b4b
BLAKE2b-256 b90f6a34f741ad4f15f49747c536044eb1a43d4a8fadddfa13684713378656ed

See more details on using hashes here.

File details

Details for the file threedigrid_builder-1.17.0-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for threedigrid_builder-1.17.0-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a4ebe892d8163acf202f1ebc1dc07a1d56741bcf1dc82b4c39409d597548c9a3
MD5 748e00ec0f38fbbef8ff385ab5167061
BLAKE2b-256 c2469ec581bb72e62d8d7ae18cb95d23014e7838d402a1af5451eb33716ab396

See more details on using hashes here.

File details

Details for the file threedigrid_builder-1.17.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for threedigrid_builder-1.17.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 1a84a68f705cca2aae4df6870b5ed9c67498b2b7de651d7f2269bb5c75cb3679
MD5 6b5d618775655ec38c2322f62ca4aa94
BLAKE2b-256 9663bc1f271b291be432f4db390dc8bee6854ee1894b72816f142f57801b3f5b

See more details on using hashes here.

File details

Details for the file threedigrid_builder-1.17.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for threedigrid_builder-1.17.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 43f570e5ee43441b2456a64ae790826fc0a348025a58b8531d2e007f76ab9141
MD5 b440e9c955c8e517169b0a7f792090b8
BLAKE2b-256 7a7d31875a5ca45cd05ecce3045b8fe791592e5bb49dae2e7670ac0ec3291c9a

See more details on using hashes here.

File details

Details for the file threedigrid_builder-1.17.0-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for threedigrid_builder-1.17.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 fbc40f33a422f014a42079f2bf1e69dacc65d0aa7ecc24f0cf7f00f787f0b531
MD5 0537a19e04a5708d8b81516bb0711086
BLAKE2b-256 01e7f20d326eabd015afca7b979a6a18efb0298eb1b11c7a92d6b1c057a0bd0d

See more details on using hashes here.

File details

Details for the file threedigrid_builder-1.17.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for threedigrid_builder-1.17.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 3b199a4a7cdbd72f92b445d114990570f986c935f015cd3f41d436defe91d25a
MD5 18ea60a66c645038fbc94a12db9f2c0f
BLAKE2b-256 4257d62635d7cafb10003bf9b6cfca50c8bc4a3ab73e5794ce95cfb65d48c5a4

See more details on using hashes here.

File details

Details for the file threedigrid_builder-1.17.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for threedigrid_builder-1.17.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a12002e50cb9413c6b95ca7999a9e07810848a50499e2f4d2929f8815dc14ccf
MD5 7ac333f4272e0631ee01cd09fefb0208
BLAKE2b-256 d42208b7f0c1c28f5227e640fc5f216853b90b8ae616e72944a35e822cffc6ec

See more details on using hashes here.

File details

Details for the file threedigrid_builder-1.17.0-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for threedigrid_builder-1.17.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d8d2456424339c84bee894be51762f402e8b25a8e8b95fc200f4aeba23b17d84
MD5 ae4497ae92ae333f66a908ceab18883a
BLAKE2b-256 320b067fbd0d41ad4df2cd874c5d3415b145a1a78c3ac60b064d3c5df52f9644

See more details on using hashes here.

File details

Details for the file threedigrid_builder-1.17.0-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for threedigrid_builder-1.17.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 cf409d5dcd341122bd907210bb02e03d3818ba8f9cc83111bf5b770175c43400
MD5 f288a4caf86f7b22c7d04ccb640d34f2
BLAKE2b-256 e0cb3b8c21f69f807e1436bd467df7d9a99e0ec68ea84b97e8ec5d0ce3a45aef

See more details on using hashes here.

File details

Details for the file threedigrid_builder-1.17.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for threedigrid_builder-1.17.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8aa24c3824b006a133f0232f4d68b7cd9bff1d7045745262f807f2af8fd37c3e
MD5 3a1c47aee4df34c61bba6d8268c86acb
BLAKE2b-256 d53806d03f87dd5992638a1811bdfade48b2d5d2f68bf4f5d50d79124bd50aba

See more details on using hashes here.

File details

Details for the file threedigrid_builder-1.17.0-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for threedigrid_builder-1.17.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 5a4f9eeb0d6749b8fab3ce70ff3a337e9712af14d2ea8722bdf8cffef0dd69b9
MD5 fff2eff8cddbc71f669425f07c9c8ef6
BLAKE2b-256 99e439b7558ff8ecb4930f8c6ff97f1d9c1c54b47af0e17252bb6db1a5463911

See more details on using hashes here.

File details

Details for the file threedigrid_builder-1.17.0-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for threedigrid_builder-1.17.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 3b6badc4454f80cf91bbdc9ad507d9eaf7196976424f12b3c17f1fa5c1039baa
MD5 5792c75303b949ed1355bbdb57c55680
BLAKE2b-256 cdeab2a6336724b9fa2e53315410a9efd05891abcc96de87c9302477f390f14f

See more details on using hashes here.

File details

Details for the file threedigrid_builder-1.17.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for threedigrid_builder-1.17.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8058f04385d027164558ffb8952d4c325257be56c2591bb149106d706c6a15e5
MD5 29f52433663e377ae360e6bce73ef17e
BLAKE2b-256 b76a828470fc4c45cb3f8f046f3b737a6a527ad7d9959916ce05c153d8d5ae60

See more details on using hashes here.

File details

Details for the file threedigrid_builder-1.17.0-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for threedigrid_builder-1.17.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 21c3a314652c8b7731ba59fdaa7fd12c34e50bca43af27073893d0e1f1d65198
MD5 613a9505860944e537ea0210f9649575
BLAKE2b-256 05bef93a51c1d780dbee6338b6e1270f1d3c04dc2c5018d65f2f49c0850877aa

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