Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[abrt] numpy-f2py: capi_maps.py:378:getpydocsign:KeyError: 'void' #4645

Closed
opoplawski opened this issue Apr 28, 2014 · 8 comments
Closed

[abrt] numpy-f2py: capi_maps.py:378:getpydocsign:KeyError: 'void' #4645

opoplawski opened this issue Apr 28, 2014 · 8 comments

Comments

@opoplawski
Copy link

Reported in Fedora here: https://bugzilla.redhat.com/show_bug.cgi?id=1091994

This always happens when running "make python" after checking out this
repository:
https://github.com/Ithanil/quaternions-fortran03.git

Version-Release number of selected component:
numpy-f2py-1.8.0-4.fc20

Additional info:
reporter:       libreport-2.2.2
cmdline:        /usr/bin/python /usr/bin/f2py -m quaternions quaternions.F03
executable:     /usr/bin/f2py
kernel:         3.13.10-200.fc20.x86_64
runlevel:       N 5
type:           Python
uid:            1000

Truncated backtrace:
capi_maps.py:378:getpydocsign:KeyError: 'void'

Traceback (most recent call last):
  File "/usr/bin/f2py", line 24, in <module>
    main()
  File "/usr/lib64/python2.7/site-packages/numpy/f2py/f2py2e.py", line 596, in
main
    run_main(sys.argv[1:])
  File "/usr/lib64/python2.7/site-packages/numpy/f2py/f2py2e.py", line 388, in
run_main
    ret=buildmodules(postlist)
  File "/usr/lib64/python2.7/site-packages/numpy/f2py/f2py2e.py", line 335, in
buildmodules
    dict_append(ret[mnames[i]], rules.buildmodule(modules[i], um))
  File "/usr/lib64/python2.7/site-packages/numpy/f2py/rules.py", line 1209, in
buildmodule
    mr, wrap = f90mod_rules.buildhooks(m)
  File "/usr/lib64/python2.7/site-packages/numpy/f2py/f90mod_rules.py", line
178, in buildhooks
    api, wrap=rules.buildapi(b)
  File "/usr/lib64/python2.7/site-packages/numpy/f2py/rules.py", line 1339, in
buildapi
    vrd=routsign2map(rout)
  File "/usr/lib64/python2.7/site-packages/numpy/f2py/capi_maps.py", line 601,
in routsign2map
    ret['pydocsign'], ret['pydocsignout']=getpydocsign(a, rout)
  File "/usr/lib64/python2.7/site-packages/numpy/f2py/capi_maps.py", line 353,
in getpydocsign
    return getpydocsign(af, var['vars'][af])
  File "/usr/lib64/python2.7/site-packages/numpy/f2py/capi_maps.py", line 378,
in getpydocsign
    sig='%s : %s %s%s'%(a, opt, c2py_map[ctype], init)
KeyError: 'void'

Local variables in innermost frame:
opt: ''
a: 'newDefaultQuaternion'
out_a: 'newDefaultQuaternion'
k: 'out=newDefaultQuaternion'
ctype: 'void'
init: ''
sigout: 'newDefaultQuaternion'
sig: 'newDefaultQuaternion'
var: {'typespec': 'type', 'intent': ['out', 'out=newDefaultQuaternion'],
'typename': 'quaternion'}
@charris
Copy link
Member

charris commented Apr 30, 2014

@pearu Thoughts?

@pearu
Copy link
Contributor

pearu commented Apr 30, 2014

Looking at the error message, one is trying to wrap Fortran type structure. This is not supported with the current f2py.

@opoplawski
Copy link
Author

Can we fail more gracefully?

@pearu
Copy link
Contributor

pearu commented Apr 30, 2014

Ideally, the type support can be implemented. This is not done due to lack of my time.

Yes, a graceful exit would be nice. This can be done so that when a Fortran routine uses Fortran types as arguments, f2py skips wrapping such functions (with a message that f2py does not support Fortran types).

Meantime, one can explicitly skip such functions:

f2py -m quaternions quaternions.F03 skip: <names of functions to be skipped>

@HaoZeke
Copy link
Member

HaoZeke commented Jun 10, 2022

This is a special case of the more general problem (not supporting derived types). When derived type support lands this shouldn't be an issue anymore.

@HaoZeke HaoZeke closed this as not planned Won't fix, can't repro, duplicate, stale Jun 10, 2022
f2py core automation moved this from To do to Done Jun 10, 2022
@bilderbuchi
Copy link
Contributor

bilderbuchi commented Oct 24, 2023

This is a special case of the more general problem (not supporting derived types). When derived type support lands this shouldn't be an issue anymore.

@HaoZeke @pearu is support for derived types being tracked anywhere? I could not find an issue for that? Or is that #15157?

@HaoZeke
Copy link
Member

HaoZeke commented Oct 24, 2023

This is a special case of the more general problem (not supporting derived types). When derived type support lands this shouldn't be an issue anymore.

@HaoZeke @pearu is support for derived types being tracked anywhere? I could not find an issue for that? Or is that #15157?

There's this draft PR: #20770 and tracking issue #21160

Along with an old repo for brainstorming: https://github.com/HaoZeke/f2py_derived_nep

I will probably get the draft in sometime (almost forgot) and the remaining issues can be handled in followups.

@bilderbuchi
Copy link
Contributor

Thank you! In my defense (😅) I stand surprised that my original search term derived type f2py did not show that issue (because f2py occurs only in the label, not the issue text. Learned something new :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

6 participants