Skip to main content

Generate a 3Di simulation grid from a model schematisation.

Project description

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 only currently supported platform is Linux.

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

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]

Changelog of threedigrid-builder

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).

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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

File details

Details for the file threedigrid_builder-0.3.0-cp39-cp39-manylinux1_x86_64.whl.

File metadata

  • Download URL: threedigrid_builder-0.3.0-cp39-cp39-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for threedigrid_builder-0.3.0-cp39-cp39-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 6eda30cfb76d23621f32ea0c9cc5f41d4f018871e17fd461f803dcdc0d61efdd
MD5 5944a952b58eac893f94288f30f7dd86
BLAKE2b-256 2b173a993ce0cc5032f67c789f48e9d1e1baf7aa84c9dd16585c59b91b4cb00a

See more details on using hashes here.

File details

Details for the file threedigrid_builder-0.3.0-cp39-cp39-manylinux1_i686.whl.

File metadata

  • Download URL: threedigrid_builder-0.3.0-cp39-cp39-manylinux1_i686.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for threedigrid_builder-0.3.0-cp39-cp39-manylinux1_i686.whl
Algorithm Hash digest
SHA256 e35f401517ec5e88dea9fa377f5b0bce04715b6c6379c1e3175fa185ffcd2083
MD5 3b90c3b06730502512fef386253e9576
BLAKE2b-256 7d6194a81b8b6f7991a4fea08bcf1e8bd4f02cdf86edb5dafcf49339d31c4540

See more details on using hashes here.

File details

Details for the file threedigrid_builder-0.3.0-cp38-cp38-manylinux1_x86_64.whl.

File metadata

  • Download URL: threedigrid_builder-0.3.0-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for threedigrid_builder-0.3.0-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c13939b1ca54b3a7ba8c410253562dc2d6cf9b4b440a33e5e62ab9f04a74e1e5
MD5 dd15ad40f0899b601f24e9362891b53a
BLAKE2b-256 39aaff16f3fa95f6018d842d23ec340aef47bd49d821443400233551df9b776e

See more details on using hashes here.

File details

Details for the file threedigrid_builder-0.3.0-cp38-cp38-manylinux1_i686.whl.

File metadata

  • Download URL: threedigrid_builder-0.3.0-cp38-cp38-manylinux1_i686.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for threedigrid_builder-0.3.0-cp38-cp38-manylinux1_i686.whl
Algorithm Hash digest
SHA256 c4fd7a73959733e76bc0a931a0462d7407616cc2755f4e765f917630d9090ebe
MD5 75713562c7516d2c57cfb4caa59ec481
BLAKE2b-256 ccf65368a4f748659c50a01cf3d7bf232c913c5a73147b847276668c4c33e646

See more details on using hashes here.

File details

Details for the file threedigrid_builder-0.3.0-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: threedigrid_builder-0.3.0-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for threedigrid_builder-0.3.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c3e0909ce53d36cfeb5b62b94ac9c15d5d93335cef43010077a888a3c1ea0475
MD5 06822b49f9b082deeb3ae183bdf77531
BLAKE2b-256 c9f3226173967e7c0c52d081ee0b6967c5c991c33e81f1eeef53b13984f7a02d

See more details on using hashes here.

File details

Details for the file threedigrid_builder-0.3.0-cp37-cp37m-manylinux1_i686.whl.

File metadata

  • Download URL: threedigrid_builder-0.3.0-cp37-cp37m-manylinux1_i686.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for threedigrid_builder-0.3.0-cp37-cp37m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 f3ffe61e397f604071744f4c47ef9b2d55b220f6e080effe8904284b571cb8da
MD5 5fb7a81e97f3cee4894ea6372f5c92df
BLAKE2b-256 50c4f10b9d3df298e51a70e064ce6257ea9666535d90afa430f67b53926e8fea

See more details on using hashes here.

File details

Details for the file threedigrid_builder-0.3.0-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: threedigrid_builder-0.3.0-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for threedigrid_builder-0.3.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 2da866b97a034bda8c35666e9a9253044b4bd01dcbef506c58073c35321164fb
MD5 d0544e09078ce6ca94113a55cdc79dc6
BLAKE2b-256 012066bd2f8046fa98d6ef16f2a99808f9b30a37fd842a5bd4fa71b83676e4f5

See more details on using hashes here.

File details

Details for the file threedigrid_builder-0.3.0-cp36-cp36m-manylinux1_i686.whl.

File metadata

  • Download URL: threedigrid_builder-0.3.0-cp36-cp36m-manylinux1_i686.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for threedigrid_builder-0.3.0-cp36-cp36m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 d76d8dddc12542d2163eeba1860dda9a239bcf58521a919938445efb8bdf9037
MD5 04d884c7f59018c15a3164e3f50d82bf
BLAKE2b-256 f3d0593a4e048047bfb3cbf66e0c3be7a0b863753de3177974c9c3a392917975

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