-
Notifications
You must be signed in to change notification settings - Fork 34
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
MLIR Plugin #881
base: main
Are you sure you want to change the base?
MLIR Plugin #881
Conversation
flush_peephole_opted_mlir_to_iostream(test_pipeline_lowering_workflow) | ||
|
||
|
||
def test_MQT_plugin() -> bool | None: |
Check notice
Code scanning / CodeQL
Explicit returns mixed with implicit (fall through) returns Note test
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 3 days ago
To fix the problem, we need to add an explicit return statement at the end of the test_MQT_plugin
function. This will ensure that the function's return value is always clear and consistent, regardless of whether an exception is raised or not. Specifically, we should add a return True
statement at the end of the function to indicate that the function completed successfully when no exception is raised.
-
Copy modified line R128
@@ -127,2 +127,3 @@ | ||
flush_peephole_opted_mlir_to_iostream(test_pipeline_mqtplugin_workflow) | ||
return True | ||
|
try: | ||
mlir_str = error_msg.split("module @module_test_pipeline_mqtplugin_workflow_transformed {")[1] | ||
mlir_str = error_msg.split("}\n}")[0] | ||
except: |
Check notice
Code scanning / CodeQL
Except block handles 'BaseException' Note test
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 3 days ago
To fix the problem, we should replace the broad except:
block with more specific exception handling. We should catch Exception
to handle general errors and allow KeyboardInterrupt
and SystemExit
to propagate. This ensures that the program can still be interrupted or terminated as expected.
- Replace the
except:
block withexcept Exception:
to handle general exceptions. - Ensure that
KeyboardInterrupt
andSystemExit
are not caught by this block.
-
Copy modified line R134
@@ -133,3 +133,3 @@ | ||
mlir_str = error_msg.split("}\n}")[0] | ||
except: | ||
except Exception: | ||
return False |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #881 +/- ##
=====================================
Coverage 92.3% 92.3%
=====================================
Files 145 145
Lines 13850 13850
Branches 2107 2107
=====================================
+ Hits 12789 12790 +1
+ Misses 1061 1060 -1
🚀 New features to boost your workflow:
|
Description
This PR introduces a MLIR plguin such that the round-trip pass can be executed with Pennylane Catalyst.
It additionally provides the plugin as a wheel.
Checklist: