-
Notifications
You must be signed in to change notification settings - Fork 25
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
Adding Device Documentation Properties #25
Changes from 5 commits
db28fda
8aa3991
20e15da
bd1adee
1861570
139340b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,14 +11,60 @@ | |
# ANY KIND, either express or implied. See the License for the specific | ||
# language governing permissions and limitations under the License. | ||
|
||
from typing import List, Tuple | ||
from typing import List, Optional, Tuple | ||
|
||
from pydantic import Field | ||
from pydantic import BaseModel, Field | ||
|
||
from braket.device_schema.device_execution_window import DeviceExecutionWindow | ||
from braket.schema_common import BraketSchemaBase, BraketSchemaHeader | ||
|
||
|
||
class DeviceCost(BaseModel): | ||
|
||
""" | ||
This class provides the details on the cost of a device. | ||
|
||
Attributes: | ||
price: Price of the device in terms of US $ | ||
unit: unit for charging the price, eg: minute, hour, task [price per task] | ||
|
||
Examples: | ||
>>> import json | ||
>>> input_json = { | ||
... "price": 0.25, | ||
... "unit": "minute" | ||
... } | ||
>>> DeviceCost.parse_raw(json.dumps(input_json)) | ||
""" | ||
|
||
price: float | ||
unit: str | ||
|
||
|
||
class DeviceDocumentation(BaseModel): | ||
""" | ||
This class provides the device metadata like image, summary of it and external documentation. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "device documentation" |
||
|
||
Attributes: | ||
imageUrl: url for the image of the device | ||
summary: brief description on the device | ||
externalDocumentationLink: link to provide any useful information to the users. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. externalDocumentationUrl |
||
|
||
Examples: | ||
>>> import json | ||
>>> input_json = { | ||
... "imageUrl": "image_url", | ||
... "summary": "Summary on the device", | ||
... "externalDocumentationUrl": "exter doc link", | ||
... } | ||
>>> DeviceDocumentation.parse_raw(json.dumps(input_json)) | ||
""" | ||
|
||
imageUrl: Optional[str] | ||
summary: Optional[str] | ||
externalDocumentationUrl: Optional[str] | ||
|
||
|
||
class DeviceServiceProperties(BraketSchemaBase): | ||
""" | ||
This class defines the common service properties for each device. | ||
|
@@ -43,6 +89,16 @@ class DeviceServiceProperties(BraketSchemaBase): | |
... } | ||
... ], | ||
... "shotsRange": [1,10], | ||
... "deviceCost": { | ||
... "price": 0.25, | ||
... "unit": "minute" | ||
... }, | ||
... "deviceDocumentation": { | ||
... "imageUrl": "image_url", | ||
... "summary": "Summary on the device", | ||
... "externalDocumentationUrl": "exter doc link", | ||
... }, | ||
... "deviceLocation": "us-east-1" | ||
... } | ||
>>> DeviceServiceProperties.parse_raw_schema(json.dumps(input_json)) | ||
|
||
|
@@ -54,3 +110,6 @@ class DeviceServiceProperties(BraketSchemaBase): | |
braketSchemaHeader: BraketSchemaHeader = Field(default=_PROGRAM_HEADER, const=_PROGRAM_HEADER) | ||
executionWindows: List[DeviceExecutionWindow] | ||
shotsRange: Tuple[int, int] | ||
deviceCost: Optional[DeviceCost] | ||
deviceDocumentation: Optional[DeviceDocumentation] | ||
deviceLocation: Optional[str] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,13 +54,28 @@ class IonqDeviceCapabilities(BraketSchemaBase, DeviceCapabilities): | |
... } | ||
... ], | ||
... "shotsRange": [1, 10], | ||
... "deviceCost": { | ||
... "price": 0.25, | ||
... "unit": "minute" | ||
... }, | ||
... "deviceDocumentation": { | ||
... "imageUrl": "image_url", | ||
... "summary": "Summary on the device", | ||
... "externalDocumentationUrl": "external doc link", | ||
... }, | ||
... "deviceLocation": "us-east-1" | ||
... }, | ||
... "action": { | ||
... "braket.ir.jaqcd.program": { | ||
... "actionType": "braket.ir.jaqcd.program", | ||
... "version": ["1.0", "1.1"], | ||
... "supportedOperations": ["x", "y"], | ||
... "supportedResultTypes": ["expectation"], | ||
... "supportedResultTypes": [{ | ||
... "name": "resultType1", | ||
... "observables": ["observable1"], | ||
... "minShots": 2, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "minShots": 0 |
||
... "maxShots": 4, | ||
... }], | ||
... } | ||
... }, | ||
... "paradigm": { | ||
|
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.
"US dollars"