threedi-modelchecker
====================
.. image:: https://img.shields.io/pypi/v/threedi-modelchecker.svg
:target: https://pypi.org/project/threedi-modelchecker/
.. image:: https://github.com/nens/threedi-modelchecker/actions/workflows/test.yml/badge.svg
:alt: Github Actions status
:target: https://github.com/nens/threedi-modelchecker/actions/workflows/test.yml
A tool to verify the correctness of a 3Di schematisation.
It asserts the correctness of a 3Di schematisation and provides detailed
information about any potential errors in it.
This package only work against a specific schematisation version. Use https://pypi.org/project/threedi-schema/ to upgrade
a schematisation version. See also the 3Di documentation at https://docs.3di.lizard.net/en/stable/d_before_you_begin.html#database-overview
Note that the name "modelchecker" might be slightly confusing: the thing that is checked is a schematisation, and not
a threedimodel. A schematisation is built interactively by the user and this schematisation will be converted to a
3Di-Model which can be used in simulations.
Installation
------------
pip install threedi-modelchecker
Note that raster checks will be skipped unless GDAL is available.
``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_schema import ThreediDatabase
sqlite_file = "<Path to your sqlite file>"
database = ThreediDatabase(sqlite_file)
model_checker = ThreediModelChecker(database)
for check, error in model_checker.errors(level="WARNING"):
print(format_check_results(check, error))
Command-line interface
----------------------
Use the modelchecker from the command line as follows::
threedi_modelchecker check -s path/to/model.sqlite -l warning
By default, WARNING and INFO checks are ignored. To skip the beta features check,
add the --allow-beta flag.
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 <https://github.com/nens/threedi-schema/blob/master/threedi_schema/migrations/README.rst>`_ 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_.
.. _zestreleaser: https://zestreleaser.readthedocs.io/en/latest/
.. _pypi: https://pypi.org/project/threedi-modelchecker/
Raw data
{
"_id": null,
"home_page": null,
"name": "threedi-modelchecker",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": "Nelen & Schuurmans <info@nelen-schuurmans.nl>",
"download_url": "https://files.pythonhosted.org/packages/c6/3a/fcb44ac483e2c431fcc25953d5016cf599805578657b2265156a39fbf623/threedi_modelchecker-2.18.11.tar.gz",
"platform": null,
"description": "threedi-modelchecker\n====================\n\n.. image:: https://img.shields.io/pypi/v/threedi-modelchecker.svg\n :target: https://pypi.org/project/threedi-modelchecker/\n\n.. image:: https://github.com/nens/threedi-modelchecker/actions/workflows/test.yml/badge.svg\n\t:alt: Github Actions status\n\t:target: https://github.com/nens/threedi-modelchecker/actions/workflows/test.yml\n\n\nA tool to verify the correctness of a 3Di schematisation.\n\nIt asserts the correctness of a 3Di schematisation and provides detailed \ninformation about any potential errors in it.\n\nThis package only work against a specific schematisation version. Use https://pypi.org/project/threedi-schema/ to upgrade\na schematisation version. See also the 3Di documentation at https://docs.3di.lizard.net/en/stable/d_before_you_begin.html#database-overview\n\nNote that the name \"modelchecker\" might be slightly confusing: the thing that is checked is a schematisation, and not\na threedimodel. A schematisation is built interactively by the user and this schematisation will be converted to a\n3Di-Model which can be used in simulations.\n\nInstallation\n------------\n\n pip install threedi-modelchecker\n\nNote that raster checks will be skipped unless GDAL is available.\n``threedi-modelchecker`` is also integrated into the ThreediToolbox Qgis plugin: https://github.com/nens/ThreeDiToolbox\n\nExample\n-------\n\nThe following code sample shows how you can use the modelchecker to run all configured\nchecks and print an overview of all discovered errors::\n\n from threedi_modelchecker.exporters import format_check_results\n from threedi_modelchecker import ThreediModelChecker\n from threedi_schema import ThreediDatabase\n\n sqlite_file = \"<Path to your sqlite file>\"\n database = ThreediDatabase(sqlite_file)\n\n model_checker = ThreediModelChecker(database)\n for check, error in model_checker.errors(level=\"WARNING\"):\n print(format_check_results(check, error))\n\n\nCommand-line interface\n----------------------\n\nUse the modelchecker from the command line as follows::\n\n threedi_modelchecker check -s path/to/model.sqlite -l warning \n\nBy default, WARNING and INFO checks are ignored. To skip the beta features check,\nadd the --allow-beta flag.\n\n\nDevelopment\n-----------\n\nA docker image has been created for easy development. It contains an postgis \nserver with an empty 3Di database to allow for easy testing.\n\nBuild the image:\n\n docker-compose build\n\nRun the tests:\n\n docker-compose run modelchecker pytest\n\nSee `Creating revisions <https://github.com/nens/threedi-schema/blob/master/threedi_schema/migrations/README.rst>`_ for \ninstructions on how to change the 3Di model schematisation.\n\nRelease\n-------\n\nMake sure you have zestreleaser_ installed.\n\n fullrelease\n\nWhen you created a tag, make sure to upload it to pypi_.\n\n.. _zestreleaser: https://zestreleaser.readthedocs.io/en/latest/\n.. _pypi: https://pypi.org/project/threedi-modelchecker/\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Checks validity of a 3Di schematisation",
"version": "2.18.11",
"project_urls": {
"Repository": "https://github.com/nens/threedi-modelchecker"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "54600344566366c74ed06155fa89bc05adec87f1ed6a52299972188080c710c5",
"md5": "b4b34b5d5eae89069ee0087a9326678e",
"sha256": "5d28a5511cc412cd44ecccb6c030136afec440634ae2c9caea9b4bd515e6e8c1"
},
"downloads": -1,
"filename": "threedi_modelchecker-2.18.11-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b4b34b5d5eae89069ee0087a9326678e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 637710,
"upload_time": "2025-07-16T09:53:56",
"upload_time_iso_8601": "2025-07-16T09:53:56.815102Z",
"url": "https://files.pythonhosted.org/packages/54/60/0344566366c74ed06155fa89bc05adec87f1ed6a52299972188080c710c5/threedi_modelchecker-2.18.11-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "c63afcb44ac483e2c431fcc25953d5016cf599805578657b2265156a39fbf623",
"md5": "40f652d2a7605cc2c6ba596b6f77f11c",
"sha256": "f5d422ef8ebc5e182ec4d7ab70225c259a70df96ee6ddb2dbb41a5331c5e5ec5"
},
"downloads": -1,
"filename": "threedi_modelchecker-2.18.11.tar.gz",
"has_sig": false,
"md5_digest": "40f652d2a7605cc2c6ba596b6f77f11c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 630668,
"upload_time": "2025-07-16T09:53:58",
"upload_time_iso_8601": "2025-07-16T09:53:58.481388Z",
"url": "https://files.pythonhosted.org/packages/c6/3a/fcb44ac483e2c431fcc25953d5016cf599805578657b2265156a39fbf623/threedi_modelchecker-2.18.11.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-16 09:53:58",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "nens",
"github_project": "threedi-modelchecker",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"requirements": [
{
"name": "Click",
"specs": []
},
{
"name": "GeoAlchemy2",
"specs": [
[
">=",
"0.14"
]
]
},
{
"name": "SQLAlchemy",
"specs": [
[
">=",
"1.4.44"
]
]
},
{
"name": "Click",
"specs": [
[
"==",
"7.0"
]
]
},
{
"name": "alembic",
"specs": [
[
">=",
"1.8"
]
]
}
],
"lcname": "threedi-modelchecker"
}