Skip to main content

Checks validity of a threedi-model

Project description

https://img.shields.io/pypi/v/threedi-modelchecker.svg Github Actions status

Threedi-modelchecker is a tool to verify the correctness of a 3Di model. The goal is to provide a tool for model builders to quickly check if his/her model is correct and can run a 3Di simulation. It provides detailed information about any potential errors in the model.

Threedi-modelchecks works with both spatialite and postgis databases. However, the database should always have the latest 3Di migration: https://docs.3di.lizard.net/en/stable/d_before_you_begin.html#database-overview

Installation:

pip install threedi-modelchecker

Threedi-modelchecker is also integrated into the ThreediToolbox Qgis plugin: https://github.com/nens/ThreeDiToolbox

Example

The following code sample shows how you can use the modelchecker to run all configured checks and print an overview of all discovered errors:

from threedi_modelchecker.exporters import format_check_results
from threedi_modelchecker import ThreediModelChecker
from threedi_modelchecker import ThreediDatabase

sqlite_file = "<Path to your sqlite file>"
database = ThreediDatabase(
    connection_settings={"db_path": sqlite_file}, db_type="spatialite"
)

model_checker = ThreediModelChecker(database)
for check, error in model_checker.errors():
    print(format_check_results(check, error))

Development

A docker image has been created for easy development. It contains an postgis server with an empty 3Di database to allow for easy testing.

Build the image:

docker-compose build

Run the tests:

docker-compose run modelchecker pytest

See Creating revisions for instructions on how to change the 3Di model schematisation.

Release

Make sure you have zestreleaser installed.

fullrelease

When you created a tag, make sure to upload it to pypi.

Project details


Release history Release notifications | RSS feed

This version

0.12

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

threedi-modelchecker-0.12.tar.gz (28.5 kB view details)

Uploaded Source

File details

Details for the file threedi-modelchecker-0.12.tar.gz.

File metadata

  • Download URL: threedi-modelchecker-0.12.tar.gz
  • Upload date:
  • Size: 28.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.0 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

File hashes

Hashes for threedi-modelchecker-0.12.tar.gz
Algorithm Hash digest
SHA256 fbdadb4ff243475417448ba9b19ed09fde3b7be7e7766d7022c1962d143f18c4
MD5 6933e4fda427520a61969a124451d7ee
BLAKE2b-256 eb1ab8b0af7b6f4e847d29e85bef6a4962679d437d424cc6cd7b2bec6af4b634

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page