Support OpenQASM end statements - #424
danielgaskins wants to merge 2 commits into
Conversation
Signed-off-by: Daniel Gaskins <danielgaskins99@gmail.com>
Argus reviewAuto-review is off for this repo. Tick the box below to run a review on this PR.
Estimated cost
Tip: you can also comment |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
👋 Hey there! It looks like the changelog might need an update. Please take a moment to edit the
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
| module.unroll() | ||
| output = dumps(module) | ||
|
|
||
| assert output.count("h q[0];") == 1 |
There was a problem hiding this comment.
Can you use already built test validators in our utilities? It seems like we already have a pretty extensive utility module built for these assertions.
| return [statement] | ||
|
|
||
| @classmethod | ||
| def _ends_with_end_statement(cls, statements: Sequence[qasm3_ast.Statement]) -> bool: |
There was a problem hiding this comment.
Why do you need all statements in this method as a parameter? I think we can just isolate the processing inside the analyser.py and refactor
TheGupta2012
left a comment
There was a problem hiding this comment.
Hi @danielgaskins , thanks for extending pyqasm with this contribution! I just gave a couple of comments but otherwise looks good. Can you also add a CHANGELOG entry besides these changes?
Summary
end;statements during validation and unrollingTesting
pytest -q tests/qasm3/test_end.pypytest -q testspytest -q --cov=pyqasm --cov-config=pyproject.toml --cov-report=term --cov-report=xml testspylint src tests bin examplesisort --check-only src tests bin examplesblack --check --target-version py310 src tests bin examplesmypy src examplesqbraid admin headers src tests bin examples --skip=src/pyqasm/_version.py --type=apachesphinx-build -W -b html docs/ <output-directory>Fixes #396