Skip to content

Commit

Permalink
Merge branch 'main' into math411-patch-4
Browse files Browse the repository at this point in the history
  • Loading branch information
AbeCoull authored Nov 16, 2023
2 parents a2ca6cc + 0485562 commit 15e42b2
Show file tree
Hide file tree
Showing 5 changed files with 674 additions and 90 deletions.
12 changes: 7 additions & 5 deletions src/braket/aws/aws_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,13 +564,15 @@ def get_devices(
>>> AwsDevice.get_devices(types=['SIMULATOR'])
Args:
arns (Optional[list[str]]): device ARN list, default is `None`
names (Optional[list[str]]): device name list, default is `None`
types (Optional[list[AwsDeviceType]]): device type list, default is `None`
arns (Optional[list[str]]): device ARN filter, default is `None`
names (Optional[list[str]]): device name filter, default is `None`
types (Optional[list[AwsDeviceType]]): device type filter, default is `None`
QPUs will be searched for all regions and simulators will only be
searched for the region of the current session.
statuses (Optional[list[str]]): device status list, default is `None`
provider_names (Optional[list[str]]): provider name list, default is `None`
statuses (Optional[list[str]]): device status filter, default is `None`. When `None`
is used, RETIRED devices will not be returned. To include RETIRED devices in
the results, use a filter that includes "RETIRED" for this parameter.
provider_names (Optional[list[str]]): provider name filter, default is `None`
order_by (str): field to order result by, default is `name`.
Accepted values are ['arn', 'name', 'type', 'provider_name', 'status']
aws_session (Optional[AwsSession]): An AWS session object.
Expand Down
12 changes: 8 additions & 4 deletions src/braket/aws/aws_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,10 +622,12 @@ def search_devices(
all the filters `arns`, `names`, `types`, `statuses`, `provider_names`.
Args:
arns (Optional[list[str]]): device ARN list, default is `None`.
names (Optional[list[str]]): device name list, default is `None`.
types (Optional[list[str]]): device type list, default is `None`.
statuses (Optional[list[str]]): device status list, default is `None`.
arns (Optional[list[str]]): device ARN filter, default is `None`.
names (Optional[list[str]]): device name filter, default is `None`.
types (Optional[list[str]]): device type filter, default is `None`.
statuses (Optional[list[str]]): device status filter, default is `None`. When `None`
is used, RETIRED devices will not be returned. To include RETIRED devices in
the results, use a filter that includes "RETIRED" for this parameter.
provider_names (Optional[list[str]]): provider name list, default is `None`.
Returns:
Expand All @@ -645,6 +647,8 @@ def search_devices(
continue
if statuses and result["deviceStatus"] not in statuses:
continue
if statuses is None and result["deviceStatus"] == "RETIRED":
continue
if provider_names and result["providerName"] not in provider_names:
continue
results.append(result)
Expand Down
Loading

0 comments on commit 15e42b2

Please sign in to comment.