(place, name, doc)
| 40 | } |
| 41 | |
| 42 | def add_newdoc(place, name, doc): |
| 43 | doc = textwrap.dedent(doc).strip() |
| 44 | |
| 45 | skip = ( |
| 46 | # gufuncs do not use the OUT_SCALAR replacement strings |
| 47 | 'matmul', |
| 48 | # clip has 3 inputs, which is not handled by this |
| 49 | 'clip', |
| 50 | ) |
| 51 | if name[0] != '_' and name not in skip: |
| 52 | if '\nx :' in doc: |
| 53 | assert '$OUT_SCALAR_1' in doc, "in {}".format(name) |
| 54 | elif '\nx2 :' in doc or '\nx1, x2 :' in doc: |
| 55 | assert '$OUT_SCALAR_2' in doc, "in {}".format(name) |
| 56 | else: |
| 57 | assert False, "Could not detect number of inputs in {}".format(name) |
| 58 | |
| 59 | for k, v in subst.items(): |
| 60 | doc = doc.replace('$' + k, v) |
| 61 | |
| 62 | docdict['.'.join((place, name))] = doc |
| 63 | |
| 64 | |
| 65 | add_newdoc('numpy.core.umath', 'absolute', |
no test coverage detected