varname,ctype,atype init,init.r,init.i,pytype vardebuginfo,vardebugshowvalue,varshowvalue varrformat intent
(a, var)
| 481 | |
| 482 | |
| 483 | def sign2map(a, var): |
| 484 | """ |
| 485 | varname,ctype,atype |
| 486 | init,init.r,init.i,pytype |
| 487 | vardebuginfo,vardebugshowvalue,varshowvalue |
| 488 | varrformat |
| 489 | |
| 490 | intent |
| 491 | """ |
| 492 | out_a = a |
| 493 | if isintent_out(var): |
| 494 | for k in var['intent']: |
| 495 | if k[:4] == 'out=': |
| 496 | out_a = k[4:] |
| 497 | break |
| 498 | ret = {'varname': a, 'outvarname': out_a, 'ctype': getctype(var)} |
| 499 | intent_flags = [] |
| 500 | for f, s in isintent_dict.items(): |
| 501 | if f(var): |
| 502 | intent_flags.append('F2PY_%s' % s) |
| 503 | if intent_flags: |
| 504 | # TODO: Evaluate intent_flags here. |
| 505 | ret['intent'] = '|'.join(intent_flags) |
| 506 | else: |
| 507 | ret['intent'] = 'F2PY_INTENT_IN' |
| 508 | if isarray(var): |
| 509 | ret['varrformat'] = 'N' |
| 510 | elif ret['ctype'] in c2buildvalue_map: |
| 511 | ret['varrformat'] = c2buildvalue_map[ret['ctype']] |
| 512 | else: |
| 513 | ret['varrformat'] = 'O' |
| 514 | ret['init'], ret['showinit'] = getinit(a, var) |
| 515 | if hasinitvalue(var) and iscomplex(var) and not isarray(var): |
| 516 | ret['init.r'], ret['init.i'] = markoutercomma( |
| 517 | ret['init'][1:-1]).split('@,@') |
| 518 | if isexternal(var): |
| 519 | ret['cbnamekey'] = a |
| 520 | if a in lcb_map: |
| 521 | ret['cbname'] = lcb_map[a] |
| 522 | ret['maxnofargs'] = lcb2_map[lcb_map[a]]['maxnofargs'] |
| 523 | ret['nofoptargs'] = lcb2_map[lcb_map[a]]['nofoptargs'] |
| 524 | ret['cbdocstr'] = lcb2_map[lcb_map[a]]['docstr'] |
| 525 | ret['cblatexdocstr'] = lcb2_map[lcb_map[a]]['latexdocstr'] |
| 526 | else: |
| 527 | ret['cbname'] = a |
| 528 | errmess('sign2map: Confused: external %s is not in lcb_map%s.\n' % ( |
| 529 | a, list(lcb_map.keys()))) |
| 530 | if isstring(var): |
| 531 | ret['length'] = getstrlength(var) |
| 532 | if isarray(var): |
| 533 | ret = dictappend(ret, getarrdims(a, var)) |
| 534 | dim = copy.copy(var['dimension']) |
| 535 | if ret['ctype'] in c2capi_map: |
| 536 | ret['atype'] = c2capi_map[ret['ctype']] |
| 537 | ret['elsize'] = get_elsize(var) |
| 538 | # Debug info |
| 539 | if debugcapi(var): |
| 540 | il = [isintent_in, 'input', isintent_out, 'output', |
nothing calls this directly
no test coverage detected