-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
ENH: add inline definition of access rights for Fortran types #15844
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, my concerns are with respect to failure scenarios caused by this new enhancement when the private/public access specifier is not provided.
Also, I am new to numpy codebase and not very familiar with fortran (or f2py), maybe a maintainer with more experience with f2py can take a look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, LGTM from my side. Maybe someone with more experience with fortran can take a look.
cc @melissawm
The tests pass but I'm hesitant to approve this as user-defined types are, in general, not supported by f2py. Maybe @pearu can weigh in on this? |
@pearu do you have an opinion on this (I guess user-defined types in f2py?), I am not sure whether we want this or not right now... |
@pearu can we get your feedback on this? Thanks! |
I've rebased the PR on main branch and added a release note. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @dcaliste for this PR! This looks good.
My review suggests some improvements to parsing derived type statements as well as exposing other attributes because we'll need these in subsequent work for supporting derived types in general.
a560ed8
to
998b7c5
Compare
Thanks a lot @pearu for your detailed review and accurate suggestions. I've updated the PR accordingly, and rebased on latest main in the process. |
@pearu , I've rebased on latest |
Hi @pearu - gentle ping to take a final look :) Thanks! |
Backported from numpy/numpy#15844 Co-authored-by: Damien Caliste <dcaliste@free.fr>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM otherwise, and should be merged later today :)
Allow to parse type definition with inline acess specifier, like: type, public :: foo end type foo
Backported from numpy/numpy#15844 Co-authored-by: Damien Caliste <dcaliste@free.fr>
Ok - let's give this a go. Thanks @dcaliste for the patience and all the reviewers for their work here! |
Allow to parse type definition with inline access specifier, like:
type, public :: foo
end type foo
This is allowed in Fortran90, see for instance https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-type-statement-derived-types
Before this MR, only:
is understood by crackfortran.