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_grid
>>> sqlite_path = "/path/to/model.sqlite"
>>> dem_path = "/path/to/dem.tiff"
>>> out_path = "grid.gpkg"  # or "something.h5" for HDF5 output
>>> make_grid(sqlite_path, dem_path, out_path)

Installation

This package is distributed as binary only, because its (Fortran) source code is proprietary. 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

Then install the threedigrid-builder:

$ pip install threedigrid-builder[rasters]

For output into a file for the 3Di calculationcore, enable gridadmin output:

$ pip install threedigrid-builder[rasters,gridadmin]

For output into Geopackage for display in e.g. QGis, enable gpkg output:

$ pip install threedigrid-builder[rasters,gpkg]

Changelog of threedigrid-builder

0.5.1 (2021-11-01)

  • Add storage_area to calculation nodes.

  • Added ds1d_half to nodes.

  • Added has_embedded to attrs.

0.5.0 (2021-10-21)

  • Fixed nodes.is_manhole in the gridadmin output.

  • Handle user-supplied 1D-2D lines (connected point / calculation point).

  • Write initial_waterlevel for 1D nodes and add ‘has_initial_waterlevels’ to meta.

0.4.0 (2021-09-23)

  • Added 1D boundary conditions.

  • Added 2D boundary conditions.

  • Enable compression in HDF5 output.

  • Fixed 2D lines that connect a larger to a smaller cell in south east direction.

0.3.1 (2021-08-16)

  • Handle embedded connection nodes. These are removed from the grid and written to a new dataset “nodes_embedded”.

  • Fixed bug with cross sections tables being None in Grid instance

  • Handle embedded channels, pipes and culverts. Embedded objects result in embedded nodes and and lines with kcu LINE_1D_EMBEDDED between between 2D cells.

  • Fixed a bug with lines that connect nodes to themselves in quadtree generation.

  • Fixed a bug with wrong usage of lines.ds1d in bottom level and cross section weights computation. The added attribute lines.s1d is now used, and for clarity nodes.ds1d was renamed to nodes.s1d.

  • Added invert_level_start_point and invert_level_end_point attributes to lines.

  • Fixed coordinate order in lines.line_geometries field in gridadmin.h5.

0.3.0 (2021-07-28)

  • Read and convert cross section definitions.

  • Solve gridadmin off-by-one errors for pumps.

  • Add ‘dmax’ to nodes output.

  • Changed external API function name to “make_gridadmin”.

0.2.1 (2021-07-20)

  • Fixed issue when reprojecting 0 grid refinements with pyproj 2.*

  • Fixed issue when writing 0 pumps with h5py 2.*

  • Fixed missing transpose when writing pumps.coordinates to HDF5.

  • Added obstacles.

0.2.0 (2021-07-15)

  • Added threedigrid_builder.grid.geo_utils with segmentize and line_substring functions. These are used to compute the Lines.line_geometries for channel lines.

  • Fixed a bug in the refinement areas code (Fortran) on Ubuntu 20.04.

  • Added the Pipes model that is able to compute Nodes & Lines from Pipes. Pipes are also included in the calculation_type and bottom_level computations.

  • Added 1D-2D lines for connection nodes, manholes, and channels.

  • Added culverts, orifices, and weirs.

  • Added pumps (pumpstations).

  • Settings and metadata are read from the SQLite. Some metadata (like model_slug) can also be provided via the main (make_grid) function. The metadata is written to the root ‘attrs’ of the output gridadmin.h5. The settings are written into datasets inside newly addres groups “grid_settings” and “tables_settings”.

  • Fixes for models with no channels.

  • Add an optional progress callback.

0.1.2 (2021-04-28)

  • Added public API with 1 function: threedigrid_builder.make_grid.

0.1.1 (2021-04-20)

  • Fixed automatic PyPI upload.

0.1.0 (2021-04-20)

  • Partially ported functionality from inpy (generate 3di files, makegrid): 1D channel grid (including calculation_type and bottom_level), and 2D open water grid.

  • Added gridadmin and geopackage output.

  • Breaking change: the interpolation between cross section locations (channels) now also extrapolates for lines and nodes that are not in between two connection nodes. This happens only if the channel has at least 2 cross section locations. When extrapolatic, the line.cross_weight is less than 0 or greater than 1.

  • Breaking change: missing or empty values in float datasets in the output gridadmin are now denoted by NaN (not-a-number) instead of -9999.0.

  • Breaking change: integers in the output gridadmin are now always 32-bit (instead of sometimes 32-bit and sometimes 64-bit).

Metadata

Release files for threedigrid-builder 0.5.1

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

Built distributions (wheels)

Table of built distributions (wheels) for threedigrid-builder 0.5.1
File
threedigrid_builder-0.5.1-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
threedigrid_builder-0.5.1-cp39-cp39-manylinux2010_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.12+ x86-64 Details
threedigrid_builder-0.5.1-cp39-cp39-macosx_10_9_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.9+ x86-64 Details
threedigrid_builder-0.5.1-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details
threedigrid_builder-0.5.1-cp38-cp38-manylinux2010_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.12+ x86-64 Details
threedigrid_builder-0.5.1-cp38-cp38-macosx_10_9_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.9+ x86-64 Details
threedigrid_builder-0.5.1-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details
threedigrid_builder-0.5.1-cp37-cp37m-manylinux2010_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.12+ x86-64 Details
threedigrid_builder-0.5.1-cp37-cp37m-macosx_10_9_x86_64.whl CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ x86-64 Details
threedigrid_builder-0.5.1-cp36-cp36m-win_amd64.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-64 Details
threedigrid_builder-0.5.1-cp36-cp36m-manylinux2010_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.12+ x86-64 Details
threedigrid_builder-0.5.1-cp36-cp36m-macosx_10_9_x86_64.whl CPython 3.6 CPython 3.6 pymalloc macOS 10.9+ x86-64 Details

Total release size: 17.9 MB

Release files / threedigrid_builder-0.5.1-cp39-cp39-win_amd64.whl

Download URL threedigrid_builder-0.5.1-cp39-cp39-win_amd64.whl
Size 862.3 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
2f4fba484f991e00bba3e06fe359813a4ae640cb15140ad6f8516c77972b4b97
BLAKE2b-256 checksum
How to use checksums
13c43dd92607dbc37578b8d018cda628a0327590423cbb279c44db2c570189a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / threedigrid_builder-0.5.1-cp39-cp39-manylinux2010_x86_64.whl

Download URL threedigrid_builder-0.5.1-cp39-cp39-manylinux2010_x86_64.whl
Size 2.0 MB
Tags CPython 3.9 Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
e5037b816bd5ebeb93487f8b79c2caf74f03979e176e296e78abd1326c47567c
BLAKE2b-256 checksum
How to use checksums
87b718cf6d1625102d4753e63c082737dc463f823bad788f4042e5ff5c9809b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / threedigrid_builder-0.5.1-cp39-cp39-macosx_10_9_x86_64.whl

Download URL threedigrid_builder-0.5.1-cp39-cp39-macosx_10_9_x86_64.whl
Size 1.6 MB
Tags CPython 3.9 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
91619fdcf420ef0bb4ce78bff58cd2bc93053e045a004fb9bd0383f5e189797b
BLAKE2b-256 checksum
How to use checksums
b9661aadabd18d670755a2c598373126ca93287d23e11430171e73bc1a6e41d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / threedigrid_builder-0.5.1-cp38-cp38-win_amd64.whl

Download URL threedigrid_builder-0.5.1-cp38-cp38-win_amd64.whl
Size 881.0 kB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
653c3164766aad1f0833ba162ebd89c0c6b26b69920eff0a440097f87c5b58b3
BLAKE2b-256 checksum
How to use checksums
ee731d2bc9b466311789db3d651e855a0f143b7c44706648da9705516ca45bba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / threedigrid_builder-0.5.1-cp38-cp38-manylinux2010_x86_64.whl

Download URL threedigrid_builder-0.5.1-cp38-cp38-manylinux2010_x86_64.whl
Size 2.0 MB
Tags CPython 3.8 Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
d06c4c45db63bc84396d7634354335d4b6664693686859a59ad8cb3961a94f3f
BLAKE2b-256 checksum
How to use checksums
543e3a8c7c31c5be5fc952da5d4c2a86ab9f1043a8d1b3ef1904697ce4272518
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / threedigrid_builder-0.5.1-cp38-cp38-macosx_10_9_x86_64.whl

Download URL threedigrid_builder-0.5.1-cp38-cp38-macosx_10_9_x86_64.whl
Size 1.6 MB
Tags CPython 3.8 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
fd35b5edf4a32491533f6e48a6bab073756ed8de083b5466c33e09ac8f4a688b
BLAKE2b-256 checksum
How to use checksums
27daadfc3c91d527ebb49b8b20cce1ceb0ae9471b2acc7bfcb5f8d4032e10ac6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / threedigrid_builder-0.5.1-cp37-cp37m-win_amd64.whl

Download URL threedigrid_builder-0.5.1-cp37-cp37m-win_amd64.whl
Size 879.3 kB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
bab334d1014c6df6ee54a28b9f63aacb38509d5cbbb7769eaaa840b119fbc4ba
BLAKE2b-256 checksum
How to use checksums
5645ff0cd60313dc68ee0e220c4c9f4d6cdb79e82f9c42db709d9eed925ca15b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / threedigrid_builder-0.5.1-cp37-cp37m-manylinux2010_x86_64.whl

Download URL threedigrid_builder-0.5.1-cp37-cp37m-manylinux2010_x86_64.whl
Size 1.9 MB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
9ea17bba725d0fd0696ab0a6bff7ed2be8c932aa06d805a93cf2c782cada81a4
BLAKE2b-256 checksum
How to use checksums
65c7e91eb4289e2329f705e86a7558e8f89828d3ee40cdec53165cd3e9e69903
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / threedigrid_builder-0.5.1-cp37-cp37m-macosx_10_9_x86_64.whl

Download URL threedigrid_builder-0.5.1-cp37-cp37m-macosx_10_9_x86_64.whl
Size 1.6 MB
Tags CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
8e0bdb040b7ce66aa07cdc3a1d322d1e05adc8158e082b3dab1e3bdf493f6089
BLAKE2b-256 checksum
How to use checksums
0c2929e6d5110a0c474443e7a118b66f3617c0af1ad07e115f61ee2279d2efea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / threedigrid_builder-0.5.1-cp36-cp36m-win_amd64.whl

Download URL threedigrid_builder-0.5.1-cp36-cp36m-win_amd64.whl
Size 879.4 kB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
fa6675ffe8b324c5b0efa4467193f126c834e3524b9210f1238e25e0802d8d69
BLAKE2b-256 checksum
How to use checksums
bdc01bad9ad47f46c59491a129b4598479329bfaf6b14c0999cf323c41be51a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / threedigrid_builder-0.5.1-cp36-cp36m-manylinux2010_x86_64.whl

Download URL threedigrid_builder-0.5.1-cp36-cp36m-manylinux2010_x86_64.whl
Size 1.9 MB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
bb3a3efa407a4f1968e560fbe7e7f6ccbb9854fa53ffcc791605cc469d49d68d
BLAKE2b-256 checksum
How to use checksums
7df4030b464a89888392cfea2b7c16b033ba861da032aa7b193b86592432fb2d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / threedigrid_builder-0.5.1-cp36-cp36m-macosx_10_9_x86_64.whl

Download URL threedigrid_builder-0.5.1-cp36-cp36m-macosx_10_9_x86_64.whl
Size 1.6 MB
Tags CPython 3.6 CPython 3.6 pymalloc macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
434ac4295ab93727b9fb46557ff61d96a236977e2b0927260f139567d03e758f
BLAKE2b-256 checksum
How to use checksums
cd1d8a1f18f8090e72886f8b751e3ba8dc6ef4a941cc3bfed38ee16fe52b4c29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Security for threedigrid-builder 0.5.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.5.1 This release

12 release files No provenance

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