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

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.2.1-cp39-cp39-manylinux1_x86_64.whl.

File metadata

  • Download URL: threedigrid_builder-0.2.1-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.1 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.2.1-cp39-cp39-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 6427567f6c98b4d4dc8e3ea141bf5b0b758b074e3b45b19fad746080fd528002
MD5 c1b35ff731556794f6d28bb8c7bc9644
BLAKE2b-256 8cd95b5b5e4946f845739db31e921200d9a5612f210b3e6ba44e75a9ecca1ade

See more details on using hashes here.

File details

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

File metadata

  • Download URL: threedigrid_builder-0.2.1-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.1 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.2.1-cp39-cp39-manylinux1_i686.whl
Algorithm Hash digest
SHA256 6ad7b6ba0646cc6ec479968033c169f3525293960090356dcbaeb796b47d6cad
MD5 15dca4c0f35259dc57e7e51b90143a51
BLAKE2b-256 df296a0b486ea678a4e26df69c72740d061a679622fd58a12dbc594951b91314

See more details on using hashes here.

File details

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

File metadata

  • Download URL: threedigrid_builder-0.2.1-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.1 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.2.1-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ec83bf31054d67b5beccbea350ebc08841f79159a77ca136cb28066484982a69
MD5 5316e3ee681b747402c2529cf455ee49
BLAKE2b-256 6b4a1428ec5e914d6dc88491d2ace7e6b5e6b3fd8f707695d050193fde04e789

See more details on using hashes here.

File details

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

File metadata

  • Download URL: threedigrid_builder-0.2.1-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.1 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.2.1-cp38-cp38-manylinux1_i686.whl
Algorithm Hash digest
SHA256 9393c4ab721dd46453f84df21764da68974732196394de9b02df2fdbde3fd4bb
MD5 83417dd9ad6b2d558d229f685d3ea942
BLAKE2b-256 78c50f6ece987506b9087b026d9820253b4cf9cf497a22c75dfc06d6dc8485f8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: threedigrid_builder-0.2.1-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.1 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.2.1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 dba5e513f388e8512ea85c6e3d3a3b49ce5a8ff812282d2059ee9c4f99888179
MD5 d4cb968a591db70e258c4b533b8aecb9
BLAKE2b-256 33493829dd54445f01401c7e5e9d65549db42338536a9fee3395ec96f18ace2d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: threedigrid_builder-0.2.1-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.1 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.2.1-cp37-cp37m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 5a11e36c51cd2e68c78192e05fad861edd8c673228f81587480415f862d5236e
MD5 4d1167cb1a7da3a1e215fd4ef057a444
BLAKE2b-256 336a677afe3db771cbe934516033e9f747c7658dc4e5ae9efedfd8eaeab78faa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: threedigrid_builder-0.2.1-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.1 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.2.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 25c18e686f0b062a93b9de1ec777721b6c21bbd0f4bc17df5ac2ba23e457d9d9
MD5 b191b4e157a9cf510d90341fe20e7d6a
BLAKE2b-256 5a46f061da9a26056dedb1277ae7ff8b484dbd99c5f50fb95f9d370c2b73034e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: threedigrid_builder-0.2.1-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.1 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.2.1-cp36-cp36m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 1bd1447044d1e039fd87d5d96af3b0f91f39fbaa555e6c3a79765512cef5ddc6
MD5 3533b6a4102d3f98cc6de20a11b48404
BLAKE2b-256 2b49dfa69781767566e3a42afd108609e3965154cf6141dceee8c67907038cc9

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