python - 从第三方包继承时,Sphinx 和 Numpydoc 会引发解析错误
问题描述
我正在尝试使用 Sphinx 和 numpydoc 来记录我的代码,但到目前为止非常不成功。当我尝试时,make html
我得到了这个非常令人困惑的错误:
Exception occurred:
File "/Users/micromegas/anaconda3/envs/sphinx4/lib/python3.7/site-packages/numpydoc/docscrape.py", line 330, in _parse_see_also
raise ParseError("%s is not a item name" % line)
numpydoc.docscrape.ParseError: order, __len__ which are identical is not a item name in 'Returns the number of nodes in the graph.\n\nReturns\n-------\nnnodes : int\n The number of nodes in the graph.\n\nSee Also\n--------\norder, __len__ which are identical\n\nExamples\n--------\n>>> G = nx.path_graph(3) # or DiGraph, MultiGraph, MultiDiGraph, etc\n>>> len(G)\n3'
The full traceback has been saved in /var/folders/kx/fc27k_8n52qcd8cylq98z7ph0000gn/T/sphinx-err-f9d7ufke.log, if you want to report the issue to the developers.
sphinx 无法解析的这个文档字符串来自我的代码继承类的依赖项。但是这种依赖是使用 Sphinx 和 numpy docstyle 本身(https://github.com/networkx/networkx)。所以我可以通过不从那个特定的类继承来摆脱错误,但这不是一个真正的解决方案。
我试图改变conf.py
类似以使其适应第三方包。没有成功。另外,也许我可以阻止狮身人面像将其包含在文档中?想...
有谁知道我可以尝试什么?
解决方案
推荐阅读
- go - 类型 reflect.Value 不支持索引
- php - 如何将循环给出的数据存储在数组中 [PHP]
- node.js - Firefox 上 api 请求的 Angular 4 问题
- sql - 如何进行此查询:“查找哪种类型的销量高于其他类型?”
- dialogflow-es - 如何限制diagflow中的范围
- elasticsearch - 在elasticsearch中编写查询,使用自定义模式分析器和普通全文搜索搜索字段(IP_address)?
- c# - UWP 用户友好的方式来检查用户是否仅授予相机权限
- rcpp - 链接到另一个包 - 未定义的符号
- html - mvc 视图只显示 json 而不是 HTML
- java - 异常完成 CompletableFuture