MCPcopy Index your code
hub / github.com/numpy/numpy / routsign2map

Function routsign2map

numpy/f2py/capi_maps.py:584–662  ·  view source on GitHub ↗

name,NAME,begintitle,endtitle rname,ctype,rformat routdebugshowvalue

(rout)

Source from the content-addressed store, hash-verified

582
583
584def routsign2map(rout):
585 """
586 name,NAME,begintitle,endtitle
587 rname,ctype,rformat
588 routdebugshowvalue
589 """
590 global lcb_map
591 name = rout['name']
592 fname = getfortranname(rout)
593 ret = {'name': name,
594 'texname': name.replace('_', '\\_'),
595 'name_lower': name.lower(),
596 'NAME': name.upper(),
597 'begintitle': gentitle(name),
598 'endtitle': gentitle(f'end of {name}'),
599 'fortranname': fname,
600 'FORTRANNAME': fname.upper(),
601 'callstatement': getcallstatement(rout) or '',
602 'usercode': getusercode(rout) or '',
603 'usercode1': getusercode1(rout) or '',
604 }
605 if '_' in fname:
606 ret['F_FUNC'] = 'F_FUNC_US'
607 else:
608 ret['F_FUNC'] = 'F_FUNC'
609 if '_' in name:
610 ret['F_WRAPPEDFUNC'] = 'F_WRAPPEDFUNC_US'
611 else:
612 ret['F_WRAPPEDFUNC'] = 'F_WRAPPEDFUNC'
613 lcb_map = {}
614 if 'use' in rout:
615 for u in rout['use'].keys():
616 if u in cb_rules.cb_map:
617 for un in cb_rules.cb_map[u]:
618 ln = un[0]
619 if 'map' in rout['use'][u]:
620 for k in rout['use'][u]['map'].keys():
621 if rout['use'][u]['map'][k] == un[0]:
622 ln = k
623 break
624 lcb_map[ln] = un[1]
625 elif rout.get('externals'):
626 externals = rout['externals']
627 errmess(f"routsign2map: Confused: function {ret['name']} has externals "
628 f'{externals!r} but no "use" statement.\n')
629 ret['callprotoargument'] = getcallprotoargument(rout, lcb_map) or ''
630 if isfunction(rout):
631 if 'result' in rout:
632 a = rout['result']
633 else:
634 a = rout['name']
635 ret['rname'] = a
636 ret['pydocsign'], ret['pydocsignout'] = getpydocsign(a, rout)
637 ret['ctype'] = getctype(rout['vars'][a])
638 if hasresultnote(rout):
639 ret['resultnote'] = rout['vars'][a]['note']
640 rout['vars'][a]['note'] = ['See elsewhere.']
641 if ret['ctype'] in c2buildvalue_map:

Callers

nothing calls this directly

Calls 15

getfortrannameFunction · 0.85
gentitleFunction · 0.85
getcallstatementFunction · 0.85
getusercodeFunction · 0.85
getusercode1Function · 0.85
errmessFunction · 0.85
getcallprotoargumentFunction · 0.85
getpydocsignFunction · 0.85
getctypeFunction · 0.85
hasresultnoteFunction · 0.85
debugcapiFunction · 0.85
isstringfunctionFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…