HasProperties类网络的作图
properties-inheritance-graph的Python项目详细描述
这个库的目的是快速而容易地创建UML图
显示HasProperties
类层次结构的继承结构。
有关HasProperties
类的更多信息,请参见
properties。
安装
pip install properties_inheritance_graph
然后在python中
fromproperties_inheritance_graphimportmake_graphimportomf# or any other library built on propertiesgraph,registry=make_graph(registry=omf.PointSetElement._REGISTRY,expand_props=True,only_new_props=True,abstract_regex='^.*Model$',)
在上面的示例中,基于OMF的属性 图书馆是用来演示的。
要将这些图形呈现到文件或jupyter笔记本中,可以使用 nxpd。Graphviz 还必须安装。
importnxpdnxpd.draw(graph,filename='inheritance_graph.png')