数据分析软件框架 dasf 的基本后端进度 API
项目描述
dasf-progress-api
DASF: Progress API是GFZ 德国地球科学研究中心 ( https://www.gfz-potsdam.de )开发的数据分析软件框架 (DASF, https://git.geomar.de/digital-earth/dasf ) 的一部分. 它由亥姆霍兹协会的倡议和网络基金通过数字地球项目 ( https://www.digitalearth-hgf.de/ ) 资助。
DASF: Progress API提供了一个轻量级的基于树的结构,通过 DASF RCP 消息协议发送。它的通用设计支持确定性和非确定性进度报告。虽然DASF: Messaging Python提供了从报告后端模块分发进度报告的必要实现,但
DASF: Web包括现成的组件以可视化报告的进度。
服务台
对于没有 Geomar Gitlab 帐户的每个人,我们都会为此存储库设置服务台功能。它使您可以通过存储库特定的电子邮件地址与开发人员进行通信。每个请求都将通过 Gitlab 问题跟踪器进行跟踪。
电子邮件:gitlab+digital-earth-dasf-dasf-progress-api-2274-issue-@git-issues.geomar.de
PyPI 包deprogressapi
DASF: Progress API以 PyPI 包的形式发布,名为deprogressapi.
您可以通过以下方式安装它:
pip install deprogressapi
用法
进度报告存储在树结构中。所以会有一个包含多个“子报告”的“根”报告实例。
为了报告进度,只需将带有类型的报告参数添加ProgressReport到公开的方法中,例如
from deprogressapi import ProgressReport
def some_exposed_method(reporter: Optional[ProgressReport] = ProgressReport(
step_message="some progress message")) -> str:
# ...
对于报表实例,可以通过该create_subreport方法创建新的子报表。每个创建的报告都会在创建和完成后自动发布(发送给请求的客户)。
# create a subreport
sub_report = root_report.create_subreport(step_message="Calculating something")
# execute some logic
# ...
# mark the sub-report as compelte
sub_report.complete()
所有子报表都是 的实例ProgressReport,因此您可以为每个子报表创建更多子报表。
错误处理
为了报告错误,您向complete方法提供错误状态参数。可以通过报告step_message字段设置相应的错误消息。
from deprogressapi.base import Status
# ...
# some code that raises an exception
# ...
except Exception as e:
error = str(e)
progress_report.step_message = "error '{msg}': {err}".format(msg=progress_report.step_message, err=error)
progress_report.complete(Status.ERROR)
推荐软件引用
Eggert, Daniel; Dransch, Doris (2021): DASF: Progress API: A progress reporting structure for the data analytics software framework. V. v0.1.4. GFZ Data Services. https://doi.org/10.5880/GFZ.1.4.2021.007
执照
Copyright 2021 Helmholtz Centre Potsdam GFZ German Research Centre for Geosciences, Potsdam, Germany / DASF Data Analytics Software Framework
Licensed under the Apache License, Version 2.0 (the "License");
you may not use these files except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
接触
博士。Daniel Eggert
电子邮件:daniel.eggert@gfz-potsdam.de
Helmholtz Center Potsdam GFZ 德国地球科学研究中心
Section 1.4 Remote Sensing & Geoinformatics
Telegrafenberg
14473 Potsdam
Germany
项目详情
下载文件
下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。
源分布
内置分布
deprogressapi -0.3.0.tar.gz 的哈希值
| 算法 | 哈希摘要 | |
|---|---|---|
| SHA256 | 9691e96e7b7a680f888e60ce1f7088cf955d40d7facbde9938b12e0784e23504 |
|
| MD5 | 4b8813ef478cec7d504e40376f248450 |
|
| 布莱克2-256 | 7e3214120293e6aa8a0aacf7155272792853b8b9268b7d9c0618c8da343be433 |
deprogressapi -0.3.0-py3-none-any.whl 的哈希值
| 算法 | 哈希摘要 | |
|---|---|---|
| SHA256 | 66e35198321bec27633172cd70513778ebd64f5928cafc83dd4056437bebe076 |
|
| MD5 | 169b07df8042694820469ebade661b47 |
|
| 布莱克2-256 | 51de7b8df7894479d624ba1ab804f55d62b8d240226c8986e62f87a007b805b4 |