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

Remove InhomogeneousTupleVariable #1838

Open
wants to merge 93 commits into
base: devel
Choose a base branch
from
Open

Conversation

EmilyBourne
Copy link
Member

@EmilyBourne EmilyBourne commented Apr 16, 2024

Remove the InhomogeneousTupleVariable class. Fixes #1583 There is now enough information in the types to make this class unnecessary. Removing it allows inhomogeneous tuples to be used in classes (as it was previously not possible to combine DottedVariable and InhomogeneousTupleVariable).

Commit Summary

  • Use the symbolic_alias category in a Scope to map an indexed element of an inhomogeneous tuple to the equivalent variable.
  • Create _build_X functions for functions which accept inhomogeneous tuple arguments (created SemanticParser._build_PythonTupleFunction and SemanticParser._build_NumpyArray). This allows the variables to be collected from the scope during the building process
  • Allow a PyccelUnarySub to be used as an index (to facilitate indexing with literals)
  • Add a is_literal_integer function to determine if an expression is a literal integer
  • Recognise inhomogeneous tuples via their class type
  • Remove InhomogeneousTupleVariable
  • Ensure IndexedElement can handle inhomogeneous tuple objects.
  • Don't declare inhomogeneous tuples (their elements are now already present in the scope)
  • Clarify use of dtype/class type in FCodePrinter._print_Declare
  • Correct type annotation printing in Python (quotes are no longer present to be removed)
  • Raise a warning if trying to wrap tuples
  • Clean up tuple handling in _visit_Assign. Fixes COVERAGE : tuples in _visit_Assign Function #1392
  • Extract printed inhomogenous tuple variables into PythonTuple at the semantic stage
  • Increase coverage
  • Add a test for inhomogeneous tuples in classes

@pyccel-bot
Copy link

pyccel-bot bot commented Apr 16, 2024

Hello again! Thank you for this new pull request 🤩.

Please begin by requesting your checklist using the command /bot checklist

@EmilyBourne EmilyBourne added the blocked Cannot be solved/merged until something else is fixed label Apr 16, 2024
@EmilyBourne
Copy link
Member Author

EmilyBourne commented Apr 23, 2024

Here is your checklist. Please tick items off when you have completed them or determined that they are not necessary for this pull request:

  • Write a clear PR description
  • Add tests to check your code works as expected
  • Update documentation if necessary
  • Update Changelog
  • Ensure any relevant issues are linked
  • Ensure new tests are passing

Copy link

@pyccel-bot pyccel-bot bot left a 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.

@EmilyBourne
Copy link
Member Author

/bot run pr_tests

Copy link

@pyccel-bot pyccel-bot bot left a 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.

@EmilyBourne
Copy link
Member Author

/bot run spelling

@EmilyBourne EmilyBourne marked this pull request as ready for review April 23, 2024 15:00
@pyccel-bot
Copy link

pyccel-bot bot commented Apr 23, 2024

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 /bot mark as ready.

@github-actions github-actions bot marked this pull request as draft April 23, 2024 15:00
@EmilyBourne EmilyBourne marked this pull request as ready for review April 23, 2024 15:00
Copy link

@pyccel-bot pyccel-bot bot left a 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.

@pyccel-bot
Copy link

pyccel-bot bot commented Apr 23, 2024

Hey @pyccel/pyccel-dev ! @EmilyBourne has just created this great new pull request! Check it out and let me know what you think!

@pyccel-bot pyccel-bot bot requested a review from a team April 23, 2024 15:03
Copy link
Contributor

@Farouk-Echaref Farouk-Echaref left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and the new docs are well written as well.

@EmilyBourne EmilyBourne marked this pull request as draft May 3, 2024 19:32
@EmilyBourne EmilyBourne marked this pull request as ready for review May 3, 2024 19:32
Copy link

@pyccel-bot pyccel-bot bot left a 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.

@pyccel-bot pyccel-bot bot added Ready_for_review Received at least one approval. Requires review from senior developer and removed needs_initial_review labels May 3, 2024
@pyccel-bot
Copy link

pyccel-bot bot commented May 3, 2024

Hey @yguclu, @EmilyBourne, this PR is looking pretty good. @EmilyBourne and @Farouk-Echaref 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 😄

@EmilyBourne EmilyBourne added Containers tuples/lists/sets/maps Type specification labels May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Containers tuples/lists/sets/maps Ready_for_review Received at least one approval. Requires review from senior developer Type specification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecate InhomogeneousTupleVariable COVERAGE : tuples in _visit_Assign Function
2 participants