Browse Source

add doc for doc_utils.py

tags/v0.4.10
ChenXin 5 years ago
parent
commit
df123bce0e
1 changed files with 8 additions and 1 deletions
  1. +8
    -1
      fastNLP/doc_utils.py

+ 8
- 1
fastNLP/doc_utils.py View File

@@ -1,4 +1,6 @@
"""undocumented"""
"""undocumented
用于辅助生成 fastNLP 文档的代码
"""

__all__ = []

@@ -15,6 +17,9 @@ def doc_process(m):
pass
else:
module_name = obj.__module__
# 识别并标注类和函数在不同层次中的位置
while 1:
defined_m = sys.modules[module_name]
if "undocumented" not in defined_m.__doc__ and name in defined_m.__all__:
@@ -25,6 +30,8 @@ def doc_process(m):
if module_name == m.__name__:
# print(name, ": not found defined doc.")
break

# 识别并标注基类,只有基类也在 fastNLP 中定义才显示
if inspect.isclass(obj):
for base in obj.__bases__:


Loading…
Cancel
Save