Skip to content

Conversation

@erick-xanadu
Copy link
Contributor

@erick-xanadu erick-xanadu commented May 1, 2025

Context: Initial integration with xDSL.

Description of the Change: Adds the initial integration for the python compiler. The run function is intended to be called from Catalyst.

[sc-89797]

@github-actions
Copy link
Contributor

github-actions bot commented May 1, 2025

Hello. You may have forgotten to update the changelog!
Please edit doc/releases/changelog-dev.md with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

@erick-xanadu erick-xanadu changed the title Integration of Python Compiler [Python Compiler] Integration of Python Compiler May 1, 2025
@codecov
Copy link

codecov bot commented May 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.69%. Comparing base (1116746) to head (21c81ea).
⚠️ Report is 402 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #7367    +/-   ##
========================================
  Coverage   99.69%   99.69%            
========================================
  Files         529      537     +8     
  Lines       50738    50873   +135     
========================================
+ Hits        50583    50718   +135     
  Misses        155      155            

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@erick-xanadu erick-xanadu force-pushed the eochoa/2025-05-01/python-compiler branch from af6e9cd to 25014a4 Compare May 2, 2025 17:45
Base automatically changed from Python_compiler_dialect to master May 5, 2025 16:39
@erick-xanadu erick-xanadu force-pushed the eochoa/2025-05-01/python-compiler branch from 8338660 to 0cc27bc Compare May 5, 2025 17:55
Copy link
Contributor

@isaacdevlugt isaacdevlugt left a comment

Choose a reason for hiding this comment

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

Don't forget the changelog! 😈

Copy link
Contributor

@mudit2812 mudit2812 left a comment

Choose a reason for hiding this comment

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

Thanks Erick, this is pretty impressive, but I'd be lying if I said I understood all of it. Can we chat about the implementation on Monday? I'd like to wrap my head around it a bit before approving.

Copy link
Contributor

@PietropaoloFrisoni PietropaoloFrisoni left a comment

Choose a reason for hiding this comment

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

I would suggest a # pragma no cover if testing is not an option right now : )

@erick-xanadu
Copy link
Contributor Author

Can we chat about the implementation on Monday?

Definitely, I also need your help with the linter. I am not sure how to apply it 😅 In Catalyst we use a make format command. :)

@erick-xanadu
Copy link
Contributor Author

@mudit2812 or @PietropaoloFrisoni how can I run the linter from PennyLane, in Catalyst I use make format

@PietropaoloFrisoni
Copy link
Contributor

@erick-xanadu In PennyLane there's no Makefile, so I usually just format with black/isort and I check locally by running pylint on the relevant file(s)

@mudit2812
Copy link
Contributor

mudit2812 commented May 14, 2025

Hey @erick-xanadu , if you use pre-commit, pylint should automatically get run every time you try to commit to pennylane. You can set it up by doing:

pip install pre-commit
pre-commit install

After this, the pre-commit hook (which includes black, pylint, and isort), should get run automatically every time you commit.

@erick-xanadu
Copy link
Contributor Author

@PietropaoloFrisoni and/or @mudit2812 is there a way to disable codecov? I already tried no cover. 🤔

@mudit2812
Copy link
Contributor

@erick-xanadu this is a good reference. Apparently using # pragma: exclude file should disable coverage for the whole file. # pragma: no cover is for single lines and closures, not files.

@erick-xanadu
Copy link
Contributor Author

@mudit2812 , I think your link says I should modify the pyproject.toml file:

[tool.coverage.report]
exclude_also = [
    # 1. Exclude an except clause of a specific form:
    'except ValueError:\n\s*assume\(False\)',
    # 2. Comments to turn coverage on and off:
    'no cover: start(?s:.)*?no cover: stop',
    # 3. A pragma comment that excludes an entire file:
    '\A(?s:.*# pragma: exclude file.*)\Z',
]

@erick-xanadu
Copy link
Contributor Author

Copy link
Contributor

@PietropaoloFrisoni PietropaoloFrisoni left a comment

Choose a reason for hiding this comment

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

Thanks a lot @erick-xanadu !

@erick-xanadu erick-xanadu added this pull request to the merge queue May 16, 2025
Merged via the queue into master with commit a7f9e22 May 16, 2025
53 checks passed
@erick-xanadu erick-xanadu deleted the eochoa/2025-05-01/python-compiler branch May 16, 2025 17:30
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.

5 participants