-
Notifications
You must be signed in to change notification settings - Fork 118
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
feat: LocalQuantumTask to use ExecutionManager #657
feat: LocalQuantumTask to use ExecutionManager #657
Conversation
Codecov Report
@@ Coverage Diff @@
## feature/execute-manager-local-quantum-task #657 +/- ##
============================================================================
Coverage 100.00% 100.00%
============================================================================
Files 121 122 +1
Lines 7891 7982 +91
Branches 1753 1770 +17
============================================================================
+ Hits 7891 7982 +91
|
if hasattr(self, "_execute_manager"): | ||
return self._execute_manager.cancel() | ||
raise NotImplementedError("LocalQuantumTask does not support cancelling") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using hasattr
, you can just do an if self._execute_manager
check, and set it to None
if not supplied
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getattr(self, "_execute_manager", None)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, just minor stuff
""" | ||
task = LocalQuantumTask() | ||
task._execution_manager = execution_manager | ||
task.async_result() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The task should be started without having to call async_result
d515025
to
a98648c
Compare
setup.py
Outdated
@@ -28,7 +28,7 @@ | |||
package_dir={"": "src"}, | |||
install_requires=[ | |||
"amazon-braket-schemas>=1.18.0", | |||
"amazon-braket-default-simulator>=1.19.0", | |||
"amazon-braket-default-simulator @ git+https://github.com/aws/amazon-braket-default-simulator-python.git@task-executor", # noqa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once you've merged the default sim changes, remember to change this branch
"amazon-braket-default-simulator @ git+https://github.com/aws/amazon-braket-default-simulator-python.git@task-executor", # noqa | |
"amazon-braket-default-simulator @ git+https://github.com/aws/amazon-braket-default-simulator-python.git@feature/execute-manager", # noqa |
tox.ini
Outdated
@@ -95,4 +95,4 @@ commands = | |||
deps = | |||
# If you need to test on a certain branch, add @<branch-name> after .git | |||
git+https://github.com/aws/amazon-braket-schemas-python.git | |||
git+https://github.com/aws/amazon-braket-default-simulator-python.git | |||
git+https://github.com/aws/amazon-braket-default-simulator-python.git@task-executor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here too
git+https://github.com/aws/amazon-braket-default-simulator-python.git@task-executor | |
git+https://github.com/aws/amazon-braket-default-simulator-python.git@feature/execute-manager |
a7302cf
into
feature/execute-manager-local-quantum-task
Issue #, if available:
Description of changes:
Testing done:
Merge Checklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.General
Tests
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.