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

Uploaded Source

Built Distributions

threedigrid_builder-1.15.1.dev1-cp312-cp312-win_amd64.whl (624.8 kB view details)

Uploaded CPython 3.12 Windows x86-64

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

Uploaded CPython 3.11 Windows x86-64

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

Uploaded CPython 3.10 Windows x86-64

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

Uploaded CPython 3.9 Windows x86-64

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

Uploaded CPython 3.8 Windows x86-64

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

File metadata

File hashes

Hashes for threedigrid_builder-1.15.1.dev1.tar.gz
Algorithm Hash digest
SHA256 17b06730bd4905888be1241db6dffd6e4671598f29af7344cc8a7faffebac004
MD5 7e9f02216ff62d28b23f44c53d47cb92
BLAKE2b-256 b619723aa071f786cdfea447c5bb395e52a7c861ba4aa4766307b1b92e31cbd9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.15.1.dev1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e41af7b4b0c1bb6f5871d74277fa97a18d6be50615da189e09ce4bbc24869cd9
MD5 fcc7b658ec375001ee0f839b6ea6f820
BLAKE2b-256 1eaf68e4660d2f7764c00f0f340468ae4c921daaf3e349583d65caf3b32b8546

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.15.1.dev1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2533fa3856f14376aad88bb555f127ba9adc5bc32358c348535d7ba77944c364
MD5 07284904e07ec252e61fee9603ce681c
BLAKE2b-256 a40b4971dcf1230c1cbb4c1b9013fa189edca01589945ba6b648fbdabf3855d3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.15.1.dev1-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 19a90ae9290e19d36561f4546c48cdc4c1241b85ead43f892291211e738d3392
MD5 d1e4c3b0a71995e7fc48e26d3303ea30
BLAKE2b-256 2d00d9a317a9efd7882f547d00839dcafdee53be63afe7f7d897f2d5fb963d44

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.15.1.dev1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 7b257abab288b676e13545dcd93935fb965bf34582364eb5fe231dc051a3f3c6
MD5 f342167f3e560b637ca3a203096eb684
BLAKE2b-256 56f09cc4f791882af90f8927abc2d17cd8df86c5c9f4bde1115c232f72039574

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.15.1.dev1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 caa037e53a1bf69626cd3441df73ee9c561cd275e038ed7b5263b9903cbbd99e
MD5 d6f1b26b1b0844ff8baa5fe77cad011f
BLAKE2b-256 348a2d7370a85ee1d9253c0b389426e6c898092e40d24cfe19da45045e1d165b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.15.1.dev1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 0a4e19407d9c8f7cc128b21111552682444363564d086806b09faf2b9811ced5
MD5 061724a61e95365933d2860e738df623
BLAKE2b-256 7e09b1e15da3883641b798530da62563f0f31d0fedafc58410688d02db159233

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.15.1.dev1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 bb02a67bb89dcf3a707f279730ca7bc70bd445795af2292e1571abb2f250c2ae
MD5 744f1a2843a9990e7527c8514eaced4e
BLAKE2b-256 2dcbf5eb2b740ed8602046c8b8d97f3fe641fb8d4ac5ace0713e660162c782db

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.15.1.dev1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 90591d64cbfc85e7e6da6dd4e72da4c8a2149d2cc8de6782d8a04bcbff9f3c69
MD5 890659827cbfae1909e946e92c609d3f
BLAKE2b-256 9b09b87b2151042209af090977c09345dd556fc452cc97b8c122fd6fd73e851d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.15.1.dev1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 5132a0adecb46d0c5ee6575243ecd12cb1d0440c1cd0b21c5177d3996b45df40
MD5 ac837f03653b5ab12417be73fe712aa4
BLAKE2b-256 9849e5c07df14b48d0ec6988a7fbb10fcdcc75644c3971852ffdbe2e901e6bdb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.15.1.dev1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 4c8c92101df5e2d40d6a0f93f620e491c806c3e8e4defbf8626d3027fdc4583e
MD5 25793835503d355ecafd23401f568328
BLAKE2b-256 16ca03fac0f5234ccda4a18aaeb49552a830abae62d2e2bdb618d3c3d3ae36b0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.15.1.dev1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e02e70eee475110c7da135fc3f803bf691d2bea2ca5f1a63c7dc10d856322865
MD5 a3dfb5b3bbfe7039e6de037bdab9281f
BLAKE2b-256 ed29be7509bbc84561754c87c1360ea53b591a3aebfe23f9f82de70915200f11

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.15.1.dev1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ecc4dbf22270ba4b6d139ec4a467b42a1c650b858e01fc5e1014354af1876ba7
MD5 d03c9732066ef078b1b64c59932273ca
BLAKE2b-256 873997724545384c040a2357a4e5383339133324de61f3ea4b20e5b751d3f18f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.15.1.dev1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 4e5d3bc6dfc41b9fb274afdc0d772449646a86019c6e2e147c8b8a3d5619e748
MD5 a6654a33264b027a972415aa20ed8be4
BLAKE2b-256 02a1aaa7147ff2d50c4c5f6709ef76434220fc8f71c910c0d7684ff9862c6814

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.15.1.dev1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ed8678a60c1c2d6d5c066891aadabdc3053afb222a9176759d2c70ff1954a093
MD5 126ed0af059d711cc527374f29de4891
BLAKE2b-256 bc5b51552dfece0d12c4f06c4eb781328231781d47ae7d116d458b2f82197187

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threedigrid_builder-1.15.1.dev1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 59eac1b2c647b199a508226d52a91ac05c79f2b82fad79c2e073715a1a55ca60
MD5 6205a15428ad3a7149e30c90b0eab85c
BLAKE2b-256 8adc543d47c7a69c1e9438fdf0070f58b8a02c97e24c4af3ef8dd8da216c62c1

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