Skip to main content

threedigrid-builder

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}.*

The current platform version of GDAL can be retrieved by:

$ gdalinfo –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]

Development

Clone the repo and fetch the LFS objects:

$ git lfs fetch origin refs/remotes/origin/master

Install the build tools:

$ sudo apt install cmake gfortran

Install platform dependencies:

$ sudo apt-get update && sudo apt-get install --yes --no-install-recommends libgdal-dev sqlite3 libsqlite3-mod-spatialite

Create and activate a virtual environment:

$ python -m venv ./venv
$ source ./venv/bin/activate

Install the dependencies. For your distribution, check the dependency matrix in .github/workflows/test.yml. For example:

$ pip install --upgrade pip wheel scikit-build-core setuptools numpy
$ pip install .[test,gridadmin] --no-cache-dir --no-build-isolation GDAL[numpy]==$(gdal-config --version)

Now you should be able to run the tests:

$ pytest
$ pytest integration_tests

For VSCode, optionally select the python interpreter corresponding to the virtual environment.

Only build the Fortran files:

$ ./build.sh

Metadata

Release files for threedigrid-builder 1.25.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for threedigrid-builder 1.25.6
File Size Uploaded
threedigrid_builder-1.25.6.tar.gz 70.1 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for threedigrid-builder 1.25.6
File
threedigrid_builder-1.25.6-cp315-cp315t-win_amd64.whl CPython 3.15 CPython 3.15 free-threading Windows x86-64 Details
threedigrid_builder-1.25.6-cp315-cp315t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.15 CPython 3.15 free-threading Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details
threedigrid_builder-1.25.6-cp315-cp315t-macosx_14_0_arm64.whl CPython 3.15 CPython 3.15 free-threading macOS 14.0+ ARM64 Details
threedigrid_builder-1.25.6-cp315-cp315-win_amd64.whl CPython 3.15 CPython 3.15 Windows x86-64 Details
threedigrid_builder-1.25.6-cp315-cp315-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.15 CPython 3.15 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details
threedigrid_builder-1.25.6-cp315-cp315-macosx_14_0_arm64.whl CPython 3.15 CPython 3.15 macOS 14.0+ ARM64 Details
threedigrid_builder-1.25.6-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
threedigrid_builder-1.25.6-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details
threedigrid_builder-1.25.6-cp313-cp313-macosx_14_0_arm64.whl CPython 3.13 CPython 3.13 macOS 14.0+ ARM64 Details
threedigrid_builder-1.25.6-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
threedigrid_builder-1.25.6-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details
threedigrid_builder-1.25.6-cp312-cp312-macosx_14_0_arm64.whl CPython 3.12 CPython 3.12 macOS 14.0+ ARM64 Details
threedigrid_builder-1.25.6-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
threedigrid_builder-1.25.6-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details
threedigrid_builder-1.25.6-cp311-cp311-macosx_14_0_arm64.whl CPython 3.11 CPython 3.11 macOS 14.0+ ARM64 Details
threedigrid_builder-1.25.6-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
threedigrid_builder-1.25.6-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details
threedigrid_builder-1.25.6-cp310-cp310-macosx_14_0_arm64.whl CPython 3.10 CPython 3.10 macOS 14.0+ ARM64 Details

Total release size: 1.4 GB

Release files / threedigrid_builder-1.25.6.tar.gz

Download URL threedigrid_builder-1.25.6.tar.gz
Size 70.1 MB
Tags Source
SHA-256 checksum
How to use checksums
f2c5dc7c120b9a4ae4f43de06518066b520ccfebf15878df84bd098fd33620aa
BLAKE2b-256 checksum
How to use checksums
badc2c85fe972a100cef38de069302198f72bf465a3c0e28da1c1befe853dc39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / threedigrid_builder-1.25.6-cp315-cp315t-win_amd64.whl

Download URL threedigrid_builder-1.25.6-cp315-cp315t-win_amd64.whl
Size 71.8 MB
Tags CPython 3.15 CPython 3.15 free-threading Windows x86-64
SHA-256 checksum
How to use checksums
1bcfc06df6d7c2a03ff4b47d1bd14cdc2399ab6dcbce2eaa3b43b446669001e3
BLAKE2b-256 checksum
How to use checksums
9fb6d47c36b33e0165268233d24cc9cc08714cc27331c9e5aea816596a3aa9b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / threedigrid_builder-1.25.6-cp315-cp315t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL threedigrid_builder-1.25.6-cp315-cp315t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 71.2 MB
Tags CPython 3.15 CPython 3.15 free-threading Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
3d68b8aeb4d63080f1b2a7f5c4e9805cb98003f3842ba64e7745d825146e851a
BLAKE2b-256 checksum
How to use checksums
6c1f408bdda1ab85ab5e8f3f35cc12e639c77e204c3ab9ce2d8da8b984c3ccdc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / threedigrid_builder-1.25.6-cp315-cp315t-macosx_14_0_arm64.whl

Download URL threedigrid_builder-1.25.6-cp315-cp315t-macosx_14_0_arm64.whl
Size 70.9 MB
Tags CPython 3.15 CPython 3.15 free-threading macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
454aef0c65d190bc7b641dc722f642ea180c5591c0bcc31d9ae56e303fc3341e
BLAKE2b-256 checksum
How to use checksums
9ea3ac1b2bb1c7d84b051792a6f982ecfb90e88ef4a84a7d9123833e1b9c3b42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / threedigrid_builder-1.25.6-cp315-cp315-win_amd64.whl

Download URL threedigrid_builder-1.25.6-cp315-cp315-win_amd64.whl
Size 71.8 MB
Tags CPython 3.15 Windows x86-64
SHA-256 checksum
How to use checksums
543e3cc6fa469ad5434182f9ca0a39e6cf91e541a3087335e43d3c046647304a
BLAKE2b-256 checksum
How to use checksums
62a762a91182691314816cddcdda060555363f153c4ae6f259852d23d5069c7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / threedigrid_builder-1.25.6-cp315-cp315-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL threedigrid_builder-1.25.6-cp315-cp315-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 71.2 MB
Tags CPython 3.15 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
5d0cefa618f15524379e0b6c98d7c93e5967363be6e8793fa2a379652e0ce505
BLAKE2b-256 checksum
How to use checksums
d44f3bf9e3efba4a7419ea8a397e2591399ee22fbdf0dd45f44d6961350659bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / threedigrid_builder-1.25.6-cp315-cp315-macosx_14_0_arm64.whl

Download URL threedigrid_builder-1.25.6-cp315-cp315-macosx_14_0_arm64.whl
Size 70.9 MB
Tags CPython 3.15 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
54f0eab20a315294b64fd71ac712c99db3e421d0332c8f6036dfa9727b4536d3
BLAKE2b-256 checksum
How to use checksums
680ad809cf0a86a8d9e5465f95daf386867f5cef36807cee504519d98ab7a0e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / threedigrid_builder-1.25.6-cp313-cp313-win_amd64.whl

Download URL threedigrid_builder-1.25.6-cp313-cp313-win_amd64.whl
Size 71.7 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
cbf764f2d2a07e32bb40682cde89d62673ac69c156f7993ddf3d878ed466f14b
BLAKE2b-256 checksum
How to use checksums
34e7c83be40ec79097c35f4c6639bac8d60781fc72b814d40eb699771e07285b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / threedigrid_builder-1.25.6-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL threedigrid_builder-1.25.6-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 71.2 MB
Tags CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
3b96c908c1e7a7d76fd9ab9f0be1f7b940256afa3047077e0b70f57f5ea05310
BLAKE2b-256 checksum
How to use checksums
a9dcf06d2607e0befc8d1cdb75504d0ad955d5f582acf98381e61e0f0c6f8dc4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / threedigrid_builder-1.25.6-cp313-cp313-macosx_14_0_arm64.whl

Download URL threedigrid_builder-1.25.6-cp313-cp313-macosx_14_0_arm64.whl
Size 70.9 MB
Tags CPython 3.13 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
d96d896949518fea0a8f88a14c1e650c670dce8a55269207334fe94eac0f8a69
BLAKE2b-256 checksum
How to use checksums
a55f7cf0d41a6a46b4c0e516974fcb3680ffb7fde4f4d833743116fb8a6cdbbe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / threedigrid_builder-1.25.6-cp312-cp312-win_amd64.whl

Download URL threedigrid_builder-1.25.6-cp312-cp312-win_amd64.whl
Size 71.7 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
ddd1c2a0669050ba96c2630159489b71c263b5276b08bdc1e3bf4ff541225a2e
BLAKE2b-256 checksum
How to use checksums
4acd23b5cf177cf7f4a47101c4662e60800617db2c03bdb113fa1cecff924dd7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / threedigrid_builder-1.25.6-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL threedigrid_builder-1.25.6-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 71.2 MB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
0dfafcb8704be62ab3ee334d48f6145637acd1f0ab616ebd41af824d27c2e286
BLAKE2b-256 checksum
How to use checksums
49c29fe78cbdf7c3794631d502502f81513c7c5677d7e8b8a941bb05aefce5b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / threedigrid_builder-1.25.6-cp312-cp312-macosx_14_0_arm64.whl

Download URL threedigrid_builder-1.25.6-cp312-cp312-macosx_14_0_arm64.whl
Size 70.9 MB
Tags CPython 3.12 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
6282493439eaa2d46d925a9d5f6e703e6650b0e43003e79542da646cc04c8df5
BLAKE2b-256 checksum
How to use checksums
eb2d145082f0ab4001513a970d20550f8621034b15d679deba6f8ff333ff5a43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / threedigrid_builder-1.25.6-cp311-cp311-win_amd64.whl

Download URL threedigrid_builder-1.25.6-cp311-cp311-win_amd64.whl
Size 71.6 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
0d177f2de021a7299652aa58b52c10f149fbb08dd391c7cbd7d349a056bd4b80
BLAKE2b-256 checksum
How to use checksums
c6349445d81b51f84da360f182afc59ef901c2eaddd75ed94b5a4528d5869cd7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / threedigrid_builder-1.25.6-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL threedigrid_builder-1.25.6-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 71.2 MB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
da5e0e6cfbc70afaededaeeb1adcdff0224c8e1a34f90952c4b862fa8f9a102e
BLAKE2b-256 checksum
How to use checksums
c37a17589f037c2bd83dafe72277fc8e63764d5fb5a330974bcf7f021b4441de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / threedigrid_builder-1.25.6-cp311-cp311-macosx_14_0_arm64.whl

Download URL threedigrid_builder-1.25.6-cp311-cp311-macosx_14_0_arm64.whl
Size 70.9 MB
Tags CPython 3.11 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
ab9d9de4bbef89584fed63ecdccc8570980c49027fd1454cfdf913ab8f28ab8e
BLAKE2b-256 checksum
How to use checksums
83e2628e0cf68e51e36e6b53001865fe500fa3f43636bd432e4787fd4cf6cac3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / threedigrid_builder-1.25.6-cp310-cp310-win_amd64.whl

Download URL threedigrid_builder-1.25.6-cp310-cp310-win_amd64.whl
Size 71.5 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
d6f12edc33555543cf6f188966564bc68fe1e594b738676dce4fe4e8bf65ed74
BLAKE2b-256 checksum
How to use checksums
530295cd320c1d338192beb9c1d0fa58e62354b08986184a5f0f3d594d216a9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / threedigrid_builder-1.25.6-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL threedigrid_builder-1.25.6-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 71.2 MB
Tags CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
eaced7e674fd75f38a9d2e677bbe7cdc5109ab8d6943519e045e6751ac2325b4
BLAKE2b-256 checksum
How to use checksums
89464a0ac5c5c9d3a924478b9962ac322917f70f304e2b69e63d142d32b1d175
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / threedigrid_builder-1.25.6-cp310-cp310-macosx_14_0_arm64.whl

Download URL threedigrid_builder-1.25.6-cp310-cp310-macosx_14_0_arm64.whl
Size 70.9 MB
Tags CPython 3.10 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
9a3f0c5b17552ad97a93cf6e0b5335317a48d23900b2d2270739e4167db3e578
BLAKE2b-256 checksum
How to use checksums
e960fe682b9a46f45e427a4b5d31d1730aa9d98d386a39d9ab6b1e3ac6f75776
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

1.25.6 This release

19 release files

1.8.0

13 release files

1.7.1

13 release files

1.7.0

13 release files

1.5.0

13 release files

1.4.0

13 release files

1.3.5

12 release files

1.3.4

12 release files

1.3.3

12 release files

1.2.1

12 release files

1.2.0

12 release files

1.1.0

12 release files

1.0.2

12 release files

1.0.1

12 release files

1.0.0

12 release files

0.9.2

12 release files

0.9.1

12 release files

0.9.0

12 release files

0.8.0

12 release files

0.7.0

12 release files

0.6.1

12 release files

0.5.0

12 release files

0.4.0

12 release files

0.3.1

8 release files

0.3.0

8 release files

0.2.1

8 release files

0.2.0

8 release files

0.1.2

8 release files

0.1.1

8 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page