SimPhoNy CUDS对象的本地实现
项目描述
OSP核心
由Fraunhofer IWM的SimPhoNy团队对核心cuds对象和类进行本地实现。基于之前版本,simphony-common(SimPhoNy,EU FP7项目(编号604005)www.simphony-project.eu)。
需求
- PyYaml(在Windows上,使用https://stackoverflow.com/a/33673823)解析yaml文件
- numpy用于CUDS的向量化属性
- websockets用于传输层
- requests用于将CUDS发送到服务器
- tox用于运行unittests
- unittest2用于运行unittests
- pympler用于性能测试
- responses用于unittesting requests
安装
OSP-core可在PyPI上获取,因此可以使用pip
进行安装
pip install osp-core
有关更详细的说明,请参阅https://simphony.readthedocs.io/en/latest/installation.html。
本体可视化
我们提供了工具ontology2dot
来可视化您的本体。您可以一起可视化已安装的命名空间和非安装的yaml文件(需要Graphviz https://graphviz.gitlab.io/)
ontology2dot <installed-namespace-1> ... <installed-namespace-n> <path/to/ontology-1.yml> ... <path/to/ontology-m.yml>
# Alternative
python -m osp.core.tools.ontology2dot <installed-namespace-1> ... <installed-namespace-n> <path/to/ontology-1.yml> ... <path/to/ontology-m.yml>
您可以使用参数-g
来分组命名空间。使用-o
来更改结果png文件的文件名。
测试
测试使用tox(pip install tox
)进行
# run tests automatically in different environments
tox
# run tests in your current environment (you must manually install unittest2, responses for that)
python -m unittest -v
文档
我们的文档位于https://simphony.readthedocs.io。
如果您想在本地上构建文档,请参阅我们的文档仓库。
示例
更多示例可在/example文件夹中找到。在那里解释了包装器的使用。
故障排除
如果安装失败,请在安装osp-core之前逐一安装依赖项。依赖项列在readme文件的顶部。
在Windows上,当您使用虚拟环境时,unittests可能会失败。对于测试传输层,我们使用pythons的子进程包启动传输层服务器。可能发生的情况是,启动的子进程没有选择正确的虚拟环境,导致服务器崩溃和相应的测试失败。根据我们的经验,如果您使用conda的虚拟环境,则不会发生这种情况。
目录结构
- osp/core -- 源代码
- tools -- 与osp-core一起使用的各种工具。
- ontology -- 实体和类的解析和生成。
- yml -- 提供的本体文件
- session -- 包装器的不同抽象类。
- examples -- 使用示例。
- tests -- 代码的unittesting
致谢
OSP-core Python包起源于欧洲项目SimPhoNy(项目编号604005)。我们想要感谢我们的项目合作伙伴,尤其是Enthought, Inc、Centre Internacional de Mètodes Numèrics a l'Enginyeria (CIMNE)和University of Jyväskylä,他们为OSP-core的一些核心概念做出了重要贡献,这些概念最初在项目https://github.com/simphony/simphony-common下演示。
项目详情
下载文件
为您的平台下载文件。如果您不确定选择哪个,请了解更多关于安装软件包的信息。
源代码分布
构建分布
osp-core-3.9.0.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 3fce5c50e95b1cad22a1fb4091294b07ae8b0050030b3ffff9ca94af2cdcdb1b |
|
MD5 | f27d39b7d39f52c497dd9abe73319271 |
|
BLAKE2b-256 | 70259dd44f264ef1eb5fad52dc0144e82e7846302fb27b419c35cbbbeb48da4e |
osp_core-3.9.0-py3-none-any.whl的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 89f7fb3adc74fde9e05808d449af4a0cf069e60d4b950412d8e7313be2e9fb03 |
|
MD5 | b86bcebd82e6ca53087d7150fea82fc6 |
|
BLAKE2b-256 | 0be8de723d25b09043ce645e3902bc1aadc22a08d79525b008765056ba3ea213 |