-
Notifications
You must be signed in to change notification settings - Fork 121
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: job decorator #729
feat: job decorator #729
Conversation
Co-authored-by: Matthew Beach <[email protected]>
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #729 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 127 129 +2
Lines 8237 8387 +150
Branches 1832 1866 +34
==========================================
+ Hits 8237 8387 +150
☔ View full report in Codecov by Sentry. |
2 loc missing coverage and a few dangling todos remaining |
src/braket/jobs/hybrid_job.py
Outdated
from logging import Logger, getLogger | ||
from pathlib import Path | ||
from types import ModuleType | ||
from typing import Any, Callable, Dict, Iterable, Optional, Union |
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.
We've now deprecated Python 3.8, so you no longer have to import Callable, Dict and Iterable
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.
Exciting, I will update this PR to use 3.9+ syntax
to resolve with #741
Co-authored-by: Aaron Berdy <[email protected]>
src/braket/jobs/hybrid_job.py
Outdated
"Serialization failed for decorator hybrid job. For troubleshooting, " | ||
"see the developer guide: #todo: link to docs with info as below" | ||
# "Serialization failed for decorator hybrid job. If you are referencing " | ||
# "an object from outside the function scope, either directly or through " | ||
# "function parameters, try instantiating the object inside the decorated " | ||
# "function instead." |
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.
Could we update this?
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.
Good call, I'm guessing we won't have the docs till after the launch? So I can put a temporary error message with the content itself instead of a link
src/braket/jobs/hybrid_job.py
Outdated
tags: dict[str, str] = None, | ||
logger: Logger = getLogger(__name__), | ||
) -> Callable: | ||
"""Creates a job by invoking the Braket CreateJob API. |
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.
This isn't valid if local=True. Could we update to make it unambiguous?
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.
Good point!
Issue #, if available:
Description of changes:
Enable running jobs via decorated functions!
Testing done:
Unit/integ/manual
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.