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

Function write_code

numpy/core/code_generators/generate_umath_doc.py:21–31  ·  view source on GitHub ↗
(target)

Source from the content-addressed store, hash-verified

19 return docstring
20
21def write_code(target):
22 with open(target, 'w') as fid:
23 fid.write(
24 "#ifndef NUMPY_CORE_INCLUDE__UMATH_DOC_GENERATED_H_\n"
25 "#define NUMPY_CORE_INCLUDE__UMATH_DOC_GENERATED_H_\n"
26 )
27 for place, string in docstrings.docdict.items():
28 cdef_name = f"DOC_{place.upper().replace('.', '_')}"
29 cdef_str = normalize_doc(string)
30 fid.write(f"#define {cdef_name} \"{cdef_str}\"\n")
31 fid.write("#endif //NUMPY_CORE_INCLUDE__UMATH_DOC_GENERATED_H\n")
32
33
34def main():

Callers 1

mainFunction · 0.85

Calls 5

openFunction · 0.85
normalize_docFunction · 0.85
replaceMethod · 0.80
upperMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected