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

[DICT] Add support for pop() method #1891

Open
wants to merge 29 commits into
base: devel-issue1894
Choose a base branch
from

Conversation

EmilyBourne
Copy link
Member

@EmilyBourne EmilyBourne commented May 17, 2024

Add support for the dict method pop() and the initialisation of a dictionary via a call to {}. Syntactic, semantic and Python printing support is added. The DictType datatype is expanded to match the expected description from the docs. The class PythonDict is added to manage the initialisation. The abstract class DictMethod and the subclass DictPop are defined to handle the pop() method. Fixes #1886.

Blocked by #1897

@EmilyBourne
Copy link
Member Author

EmilyBourne commented May 17, 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

@pyccel-bot
Copy link

pyccel-bot bot commented May 17, 2024

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

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

@EmilyBourne EmilyBourne marked this pull request as ready for review May 17, 2024 08:46
@github-actions github-actions bot marked this pull request as draft May 17, 2024 08:47
@pyccel-bot
Copy link

pyccel-bot bot commented May 17, 2024

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

@EmilyBourne EmilyBourne marked this pull request as ready for review May 17, 2024 09:18
@github-actions github-actions bot marked this pull request as draft May 17, 2024 09:19
@pyccel-bot
Copy link

pyccel-bot bot commented May 17, 2024

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

@EmilyBourne EmilyBourne marked this pull request as ready for review May 17, 2024 09:26
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.

There seems to be lines in this PR which aren't tested. Please take a look at my comments and add tests which cover the new code.

If this is modified code which cannot be easily tested in this PR please open an issue to request that this code be either removed or tested. Once you have done that please leave a message on the relevant conversation beginning with the line /bot accept and referencing the issue.

Similarly if the new code cannot be tested for some reason, please leave a comment beginning with the line /bot accept on the relevant conversation explaining why the code can't be tested.

pyccel/ast/builtins.py Outdated Show resolved Hide resolved
pyccel/ast/datatypes.py Outdated Show resolved Hide resolved
pyccel/ast/datatypes.py Outdated Show resolved Hide resolved
@@ -843,6 +847,22 @@ def _print_ListMethod(self, expr):

return f"{list_obj}.{method_name}({method_args})\n"

def _print_DictMethod(self, expr):
method_name = expr.name
Copy link

Choose a reason for hiding this comment

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

This code isn't tested. Please can you take a look

Copy link
Member Author

Choose a reason for hiding this comment

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

/bot accept
Added for completeness. Will be tested in my next PR

pyccel/parser/semantic.py Outdated Show resolved Hide resolved
@github-actions github-actions bot marked this pull request as draft May 17, 2024 09:46
@pyccel-bot
Copy link

pyccel-bot bot commented May 17, 2024

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

@EmilyBourne
Copy link
Member Author

/bot run coverage

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.

There seems to be lines in this PR which aren't tested. Please take a look at my comments and add tests which cover the new code.

If this is modified code which cannot be easily tested in this PR please open an issue to request that this code be either removed or tested. Once you have done that please leave a message on the relevant conversation beginning with the line /bot accept and referencing the issue.

Similarly if the new code cannot be tested for some reason, please leave a comment beginning with the line /bot accept on the relevant conversation explaining why the code can't be tested.

pyccel/ast/builtins.py Outdated Show resolved Hide resolved
@EmilyBourne
Copy link
Member Author

This PR is now too large. I am going to split it into 3

@EmilyBourne EmilyBourne added the blocked Cannot be solved/merged until something else is fixed label May 17, 2024
@EmilyBourne EmilyBourne changed the base branch from devel to devel-issue1894 May 21, 2024 07:21
@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 pr_tests

@EmilyBourne EmilyBourne marked this pull request as ready for review May 21, 2024 08:26
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 May 21, 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 May 21, 2024 08:28
@pyccel-bot
Copy link

pyccel-bot bot commented May 21, 2024

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

Copy link
Contributor

@mustapha-belbiad mustapha-belbiad 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.

@pyccel-bot
Copy link

pyccel-bot bot commented May 21, 2024

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 😄

@pyccel-bot pyccel-bot bot added the Ready_for_review Received at least one approval. Requires review from senior developer label May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Cannot be solved/merged until something else is fixed Ready_for_review Received at least one approval. Requires review from senior developer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DICT] Add Python support for pop
2 participants