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

Function compare

tools/refguide_check.py:287–333  ·  view source on GitHub ↗

Return sets of objects from all_dict. Will return three sets: {in module_name.__all__}, {in REFGUIDE*}, and {missing from others} Parameters ---------- all_dict : list List of non deprecated sub modules for module_name others : list List of su

(all_dict, others, names, module_name)

Source from the content-addressed store, hash-verified

285
286
287def compare(all_dict, others, names, module_name):
288 """
289 Return sets of objects from all_dict.
290 Will return three sets:
291 {in module_name.__all__},
292 {in REFGUIDE*},
293 and {missing from others}
294
295 Parameters
296 ----------
297 all_dict : list
298 List of non deprecated sub modules for module_name
299 others : list
300 List of sub modules for module_name
301 names : set
302 Set of function names or special directives present in
303 docstring of module_name
304 module_name : ModuleType
305
306 Returns
307 -------
308 only_all : set
309 only_ref : set
310 missing : set
311 """
312 only_all = set()
313 for name in all_dict:
314 if name not in names:
315 for pat in REFGUIDE_AUTOSUMMARY_SKIPLIST:
316 if re.match(pat, module_name + '.' + name):
317 break
318 else:
319 only_all.add(name)
320
321 only_ref = set()
322 missing = set()
323 for name in names:
324 if name not in all_dict:
325 for pat in REFGUIDE_ALL_SKIPLIST:
326 if re.match(pat, module_name + '.' + name):
327 if name not in others:
328 missing.add(name)
329 break
330 else:
331 only_ref.add(name)
332
333 return only_all, only_ref, missing
334
335
336def is_deprecated(f):

Callers 1

check_itemsFunction · 0.70

Calls 1

addMethod · 0.45

Tested by

no test coverage detected