Feature/ Added unroll command in PYQASM CLI#224
Conversation
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
src/pyqasm/cli/unroll.py
Outdated
|
|
||
| except (ValidationError, UnrollError, QasmParsingError) as err: | ||
| failed_files.append((file_path, err)) | ||
| except Exception as uncaught_err: # pylint: disable=broad-exception-caught |
There was a problem hiding this comment.
If we are creating the file at output_path and an error occurs, better to add a remove file in this exception block
There was a problem hiding this comment.
Actually, if output path already exists, files might get effect from remove. instead i will try writing to temp file if it succeed then remove the tempfile and add it to output file.
TheGupta2012
left a comment
There was a problem hiding this comment.
Hi @vinayswamik , looks good overall! Gave some comments related to refactoring and minor updates to error handling / reporting
- Added `unroll` command to PYQASM cli. - Added test cases.
- code refactor
- code refactor
Co-authored-by: Harshit Gupta <harshit.11235@gmail.com>
- Updated `unroll` command in `main.py` to accept optional parameters for `skip_files` and `overwrite`. - Introduced a new method in `QasmModule` to determine if files should be skipped based on specific tags. - Enhanced error reporting in the `unroll_qasm` function to include raw logger output for better debugging. - Added comprehensive tests for the `unroll` command, covering various scenarios including file skipping, output handling, and error cases.
7fedb2c to
0c43714
Compare
TheGupta2012
left a comment
There was a problem hiding this comment.
Hi @vinayswamik , changes lgtm - just one edit about skip files and then we should be good to merge!
Summary of changes
Add unroll command to PyQASM CLI
unrollcommand for unrolling OpenQASM files, allowing users to process multiple files or directories.-sor--skip), overwriting original files (--overwrite), and specifying output paths (--outputor-o).unroll.pymodule to handle the unrolling logic.Closes #189