-
Notifications
You must be signed in to change notification settings - Fork 55
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
Allow homogeneous tuples as function arguments #1850
base: devel
Are you sure you want to change the base?
Conversation
Hello again! Thank you for this new pull request 🤩. Please begin by requesting your checklist using the command |
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 docs |
/bot run pylint pyccel_lint spelling docs |
/bot run pylint |
It seems like you have forgotten to complete your checklist for this pull request. Please check the list here, fix the missing items and let me know when everything is ticked and fixed with |
Unfortunately your PR is not passing the tests so it is not quite ready for review yet. Let me know when it is fixed with |
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.
Hey @pyccel/pyccel-dev ! @EmilyBourne has just created this great new pull request! Check it out and let me know what you think! |
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.
Looks Good to me.
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.
Hey @yguclu, @EmilyBourne, this PR is looking pretty good. @EmilyBourne and @mustapha-belbiad think it is ready to merge. Could you add your expertise to confirm that this follows all the coding conventions and fits in Pyccel's future plans? Thanks 😄 |
Allow 1D homogeneous tuples as function arguments. Fixes #738. Homogeneous tuples as arguments already worked in the low level code as homogeneous tuples are handled as arrays, however the wrapper was missing which meant that such functions couldn't be called from Python. In order to handle multi-level tuples some reorganisation of the wrapper was necessary. Namely the introduction of the
_extract_X_FunctionDefArgument
functions. However Python multi-level tuples may have different lengths in the elements. It proved difficult to check the size of the elements in a generic way so this was left for later work (the obvious solution is to use lists to support this).Commit Summary
BindCFunctionDefArgument
to handle tuples as strideless arraysPython.h
. Group these functions together inast.cwrapper
dtype
a searchable attribute ofSyntacticTypeAnnotation
_get_check_function
->_get_type_check_condition
._get_type_check_condition
to return a condition which is not a function call (e.g. a Variable)body
argument to_get_type_check_condition
to allow additional commands to be run before determining if the type is correct._extract_X_FunctionDefArgument
functions to describe container unpacking recursively_extract_HomogeneousTupleType_FunctionDefArgument
function to unpack 1D homogeneous tuples.