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