跳转到主要内容

检查3Di方案的合法性

项目描述

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

一个用于验证3Di方案正确性的工具。

它断言3Di方案的正确性,并提供有关其中任何潜在错误的详细信息。

此软件包仅适用于特定的方案版本。请使用https://pypi.ac.cn/project/threedi-schema/升级方案版本。有关3Di文档,请参阅https://docs.3di.lizard.net/en/stable/d_before_you_begin.html#database-overview

请注意,“modelchecker”这个名字可能有些令人困惑:被检查的是方案,而不是三维模型。方案是由用户交互式构建的,这个方案将被转换为可以用于模拟的3Di-模型。

安装

pip install threedi-modelchecker

请注意,除非GDAL可用,否则将跳过栅格检查。threedi-modelchecker 也已集成到ThreediToolbox Qgis插件中: https://github.com/nens/ThreeDiToolbox

示例

以下代码示例显示了如何使用modelchecker运行所有配置的检查并打印所有发现的错误概述

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

命令行界面

如下使用命令行运行modelchecker

threedi_modelchecker check -s path/to/model.sqlite -l warning

默认情况下,忽略WARNING和INFO检查。要跳过beta功能检查,请添加–allow-beta标志。

开发

已创建一个Docker镜像,便于开发。它包含一个PostGIS服务器和一个空的3Di数据库,以便于测试。

构建镜像

docker-compose build

运行测试

docker-compose run modelchecker pytest

有关如何更改3Di模型方案的说明,请参阅Creating revisions

发布

请确保已安装zestreleaser

fullrelease

在创建标签时,请确保将其上传到pypi

项目详情


发布历史 发布通知 | RSS源

下载文件

下载您平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。

源分发

threedi_modelchecker-2.12.0.tar.gz (622.0 kB 查看哈希)

上传时间

构建分发

threedi_modelchecker-2.12.0-py3-none-any.whl (629.4 kB 查看哈希)

上传时间 Python 3

由以下机构支持