MCPcopy Create free account
hub / github.com/numpy/numpy / main

Function main

tools/refguide_check.py:1112–1245  ·  view source on GitHub ↗

Validates the docstrings of all the pre decided set of modules for errors and docstring standards.

(argv)

Source from the content-addressed store, hash-verified

1110
1111
1112def main(argv):
1113 """
1114 Validates the docstrings of all the pre decided set of
1115 modules for errors and docstring standards.
1116 """
1117 parser = ArgumentParser(usage=__doc__.lstrip())
1118 parser.add_argument("module_names", metavar="SUBMODULES", default=[],
1119 nargs='*', help="Submodules to check (default: all public)")
1120 parser.add_argument("--doctests", action="store_true",
1121 help="Run also doctests on ")
1122 parser.add_argument("-v", "--verbose", action="count", default=0)
1123 parser.add_argument("--doctest-warnings", action="store_true",
1124 help="Enforce warning checking for doctests")
1125 parser.add_argument("--rst", nargs='?', const='doc', default=None,
1126 help=("Run also examples from *rst files "
1127 "discovered walking the directory(s) specified, "
1128 "defaults to 'doc'"))
1129 args = parser.parse_args(argv)
1130
1131 modules = []
1132 names_dict = {}
1133
1134 if not args.module_names:
1135 args.module_names = list(PUBLIC_SUBMODULES)
1136
1137 os.environ['SCIPY_PIL_IMAGE_VIEWER'] = 'true'
1138
1139 module_names = list(args.module_names)
1140 for name in module_names:
1141 if name in OTHER_MODULE_DOCS:
1142 name = OTHER_MODULE_DOCS[name]
1143 if name not in module_names:
1144 module_names.append(name)
1145
1146 dots = True
1147 success = True
1148 results = []
1149 errormsgs = []
1150
1151
1152 if args.doctests or args.rst:
1153 init_matplotlib()
1154
1155 for submodule_name in module_names:
1156 prefix = BASE_MODULE + '.'
1157 if not submodule_name.startswith(prefix):
1158 module_name = prefix + submodule_name
1159 else:
1160 module_name = submodule_name
1161
1162 __import__(module_name)
1163 module = sys.modules[module_name]
1164
1165 if submodule_name not in OTHER_MODULE_DOCS:
1166 find_names(module, names_dict)
1167
1168 if submodule_name in args.module_names:
1169 modules.append(module)

Callers 1

refguide_check.pyFile · 0.70

Calls 15

init_matplotlibFunction · 0.85
find_namesFunction · 0.85
printFunction · 0.85
get_all_dictFunction · 0.85
check_itemsFunction · 0.85
check_restFunction · 0.85
check_doctestsFunction · 0.85
check_documentationFunction · 0.85
lstripMethod · 0.80
startswithMethod · 0.80
stripMethod · 0.80
allFunction · 0.50

Tested by

no test coverage detected