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

Function routsign2map

numpy/f2py/capi_maps.py:589–667  ·  view source on GitHub ↗

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

(rout)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 15

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

Tested by

no test coverage detected