Skip to content

load + loadfile methods for QASM2 lowering. #159

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

Merged
merged 5 commits into from
Apr 16, 2025
Merged

Conversation

weinbe58
Copy link
Member

addresses #150

@weinbe58 weinbe58 added enhancement New feature or request qasm2 qasm2 related issues lowering labels Apr 15, 2025
Copy link

codecov bot commented Apr 15, 2025

Codecov Report

Attention: Patch coverage is 70.27027% with 11 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/bloqade/qasm2/parse/lowering.py 70.27% 11 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Contributor

github-actions bot commented Apr 15, 2025

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
6195 5306 86% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
src/bloqade/qasm2/parse/lowering.py 60% 🟢
TOTAL 60% 🟢

updated for commit: f185227 by action🐍

@weinbe58 weinbe58 requested review from Copilot and Roger-luo April 16, 2025 14:32
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

src/bloqade/qasm2/parse/lowering.py:110

  • [nitpick] The parameter 'file' in loadfile shadows a built-in. Consider renaming it to 'file_path' for clarity.
if isinstance(file, str):

src/bloqade/qasm2/parse/lowering.py:111

  • [nitpick] Instead of using os.path.split followed by pathlib.Path, consider using pathlib.Path(file) directly for improved clarity and reliability.
if isinstance(file, str): file = pathlib.Path(*os.path.split(file))

source: str,
kernel_name: str,
*,
returns: str | None = None,
Copy link
Member Author

@weinbe58 weinbe58 Apr 16, 2025

Choose a reason for hiding this comment

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

We can add multiple returns later, but you can't do this for a standard qasm2 file because we do not support tuples.

Copy link
Member

Choose a reason for hiding this comment

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

yeah I think this is ok.

@weinbe58 weinbe58 merged commit 6471e8f into main Apr 16, 2025
10 of 11 checks passed
@weinbe58 weinbe58 mentioned this pull request May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request lowering qasm2 qasm2 related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants