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

Fix Map, Enumerate and Zip in comprehension list #1412

Draft
wants to merge 6 commits into
base: devel
Choose a base branch
from
Draft

Conversation

smhah
Copy link
Contributor

@smhah smhah commented Jun 1, 2023

  • Modify line 194 {(if rank == 0)...} to not assert error if shape == (), to consider it as None because of a runtime error.

  • Fix Enumerate zip map in comprehension list using Iterate class used in normal for loops.

  • Work with nested variable in indices variable to prevent conflict with tuple variables and variables used in nested loops.

    • For example if we have expr.indices = [(a,b), c] or expr.indices = [a,(b,c)].
      To fix this conflict I changed indices to a nested list.
      expr.indices = [(a,b), c] => indices = [[a,b], c]].
      But the problem is an error gets raised at the returning of the codeblock in FunctionalFor
      "Basic child cannot be a tuple of tuples"
      So at the end of FunctionalFor I changed the nested list indices variable to a normal list variable.

@github-actions
Copy link

github-actions bot commented Jun 1, 2023

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

Don't forget to let me know when it is complete with the command /bot mark as ready.

Here is your checklist:

  • 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

@smhah smhah changed the title Fix Enumerate and Zip in comprehension list Fix Map, Enumerate and Zip in comprehension list Jun 25, 2023
@EmilyBourne
Copy link
Member

@smhah what is the status of this PR?

@EmilyBourne EmilyBourne self-assigned this May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enumerate/Zip don't work in a loop comprehension Can't iterate over an enum, map or zip in a functional for
2 participants