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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.12 Windows x86-64

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

Uploaded CPython 3.11 Windows x86-64

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

Uploaded CPython 3.10 Windows x86-64

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

Uploaded CPython 3.9 Windows x86-64

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

Uploaded CPython 3.8 Windows x86-64

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

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev2.tar.gz
Algorithm Hash digest
SHA256 0ce6eae5ad10d938a64039a95de7db119ba49fdadbf6b8f6f2551fd6bfc794bc
MD5 14eac3aabc618573185c4a5b39b0313b
BLAKE2b-256 e6e42624f4fc8fa0026b86e439e9798a6b5c2f02af43e44e84405fd4d22493fc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 d3ffb15050d4f988ff2b6d5a2c667a17e62298218987b8afc9d0420d46026013
MD5 e5525b065807ed67b13e81a3076e78b8
BLAKE2b-256 10ee91880a9b14b813171f97ba405cba6cc28373700a06813a7b42217fd1fd9f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 38616699e5a7d5568fb136d27f479a80034b186ad0c9b2278e2c9f8381bd9536
MD5 642e571685a66cd24d0c42fe72948bab
BLAKE2b-256 98abf3eff381aca02ed334e5772f6b2d980d6972ad890ddb0574a5e0c1b31d11

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev2-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6a5998ac075cfc15903eaf4b1c467fe09083c4067bc24a33f678f95d5d81f3a6
MD5 64a21237a5eff488bdee3cfb9d7c59e5
BLAKE2b-256 ff952bfe57633c14a615bc8c4e740c2e6d50b348b04ca4fe80f277fc41d0caa9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 6682851c20f2c65399126da60026a498cb624d4907ed64ed8fd661fdd525fc74
MD5 e7738139fcd1595713912505e307e9be
BLAKE2b-256 2f553155a5f3c336a6bf86108aba2686ac1f6637bc31c8cdd44b9794572c1ea9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 550ba2bbed5d64505dcd4215fac151de896e801d17664cc8028d7425f44ca6c0
MD5 1f166a03c54b64575aaa4c2201a50588
BLAKE2b-256 d2274e9fb4ec4ed4a2f17d043c8333efa8c7c4671a55a8ff514d7a170d479b3e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev2-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b505650e0cf2e5d7fcf371595e5ca87fc059a0f842214c432cebd491022bc256
MD5 c8cf624ab4555967ef6bc1bffb94bf05
BLAKE2b-256 4e911199e10858922ae0f05ba3765c4d4ff1dd6044fb6a062a2f1132cb005686

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 bb998bce71bf744731a2055f4ad9b6e762c0ba138f0d7c5a737669f7e1e01968
MD5 ea8c23c511c3add7c689a53bf142adbe
BLAKE2b-256 5d2a8253bc756336aa5233180f0e6633bf603d9e64bde6d3afc6204edf9ff2d3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cf837412748bbb3323c7015297648e97d2694fdb2ac5c6318be34428d73bcff5
MD5 c3ad3f02c91d9077ca80f0706ed8836b
BLAKE2b-256 306231b97b8034ab5a159aeb668b543794f535f0e8f4940fc1f552f4196d4bf0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev2-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 64824c06061a94da16fa6761de93260b453b569e2d7ac4560c091503589f0d56
MD5 82b2de1da1fc8b3f9321beb325e1823c
BLAKE2b-256 72be26f061b97783de86640b1f0db83091f0dabfc58d63ca1550492b77c0867a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 56c1ec09440d1ce8729b8f9105474e019d3da495f35ae59876728a2dd8f9e312
MD5 086d37d3e1519dfc3894ef7dea7c8d3f
BLAKE2b-256 2e33fb7d4db1655cdc995bdac69298ea90d40853713529799bd06a029e79324e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dabdd4d34545fbf561e3fa7596746df9e293b81cafa8e2721f85f9882d0e6d73
MD5 c047a6147e57bc25c8f3ca36b8502529
BLAKE2b-256 8e648a48db4f6c2fbfca390a90288dbec80dcd846ae21465ccb58cea503f459c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev2-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 318445a807db96df8f5a32951807971737680eb911156e7a9602dcc51a541ce3
MD5 a619c17a3e9e5503db1abd4fea0747ea
BLAKE2b-256 20df2bf1de585cd9f00928ef8839d2c2e202c4ac3c04512ce19eee47b53b1d1d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 d8b867f5be458fcf7e37ddc7bbd8750d030add5ab25a07d1da208dcc0c7df3aa
MD5 305a0c126e1d072f4cd70adf5405ae35
BLAKE2b-256 11ac1c1214fe62d33b9de59ee90ba8db21e15abf103f701745e4d19bf8674403

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 962591f11fca764e00694741a3c2f40305306b1f89840ca97c1998d5e6d5f026
MD5 51b6f82f344225a33dde704e315d43a7
BLAKE2b-256 0f4eaeb269c28274a4420dfd8f154444d32780fac8845b00a98b23d3741eb9e0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.14.1.dev2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 3b571b4aaa240a3bb124b6991f7a3c1bf66994815b9b69f4e42688fff7acd972
MD5 c1db5db22f9da780927647ffc53668df
BLAKE2b-256 0e47ad2b1c2bb38fe8a9c297fb9bb91b9385b3685609c0d39d0cbcdc48228ad1

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