-
Notifications
You must be signed in to change notification settings - Fork 56
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
C to Python wrapper rewrite #1477
Conversation
/bot run linux |
Hello again! Thank you for this new pull request 🤩. Here is your checklist. Please tick items off when you have completed them or determined that they are not necessary for this pull request:
|
/bot run linux |
/bot run linux |
/bot run linux |
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.
Good job! This is a very neat refactoring! I have minor comments as usual.
@EmilyBourne, @yguclu has a few questions/comments about your code. Can you go through and see if you agree with them. If not go ahead and explain why. Once you've adressed all the comments let me know with |
/bot run linux docs |
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.
Good job ! Your PR is using all the code it added/changed.
@yguclu, @EmilyBourne has been working hard and thinks that they have now replied to or fixed all your comments. Could you take another look at the PR and see if you can approve now? |
@EmilyBourne We forgot to update the version in the CHANGELOG file. I will fix this in the next available PR. |
Oops. Probably all the changelogs need updating so the changes appear in the correct version |
We will definitely have some conflicts. Anyway, does this CHANGELOG look good to you? |
Looks good |
The C-Python API wrapper is unnecessarily complicated. It is very hard to understand and this makes it extremely difficult to develop any new features (e.g. class wrapping, see phase 3 of #453).
This PR completely rewrites the wrapper following the example already set by the bind-C wrapper. An additional stage is added to the treatment which wraps the code. In turn the
CWrapperPrinter
is stripped back to only retain printing functionalites.List of changes
c_to_python_wrapper
module, which contains the classCToPythonWrapper
CToPythonWrapper
object in functioncreate_shared_library
of modulepython_wrapper
clone
method ofFunctionDef
BindCArrayVariable
andBindCVariable
to AST of bind-C (i.e. Fortran-to-C) wrapperPyFunctionDef
,PyInterface
andPyModule
to AST of C-to-Python wrapperfree_array
andfree_pointer
of Numpy extension