Skip to content

Commit

Permalink
fix: Bump dep versions, fix tests, and change to new IonQ device name (
Browse files Browse the repository at this point in the history
  • Loading branch information
kshyatt-aws authored Jul 25, 2023
1 parent c408649 commit d1cd7e8
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 49 deletions.
22 changes: 11 additions & 11 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Braket"
uuid = "19504a0f-b47d-4348-9127-acc6cc69ef67"
authors = ["Katharine Hyatt <[email protected]>"]
version = "0.7.4"
version = "0.7.5"

[deps]
AWS = "fbe9abb3-538b-5e4e-ba9e-bc94f4f92ebc"
Expand Down Expand Up @@ -30,29 +30,29 @@ Tar = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[compat]
AWS = "=1.85.0"
AWSS3 = "=0.10.3"
AWS = "=1.90.0"
AWSS3 = "=0.11.2"
Aqua = "=0.6"
AxisArrays = "=0.4.6"
CSV = "=0.10.10"
AxisArrays = "=0.4.7"
CSV = "=0.10.11"
Cairo = "=1.0.5"
Colors = "=0.12.10"
Compat = "=4.6.1"
Compat = "=4.7.0"
Compose = "=0.9.4"
CondaPkg = "=0.2.17"
DataStructures = "=0.18.13"
DecFP = "=1.3.1"
DataStructures = "=0.18.14"
DecFP = "=1.3.2"
Distributions = "=0.25.76"
GraphPlot = "=0.5.2"
Graphs = "=1.8.0"
HTTP = "=1.8.1"
JSON3 = "=1.12.0"
HTTP = "=1.9.14"
JSON3 = "=1.13.1"
Markdown = "=0.7.5"
Mocking = "=0.7.6"
NLopt = "=0.6.5"
NamedTupleTools = "=0.14.3"
Optim = "=1.7.4"
OrderedCollections = "=1.6.0"
OrderedCollections = "=1.6.2"
Plots = "=1.38.5"
SimpleWeightedGraphs = "=1.2.2"
StructTypes = "=1.10.0"
Expand Down
6 changes: 3 additions & 3 deletions PyBraket/Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PyBraket"
uuid = "e85266a6-1825-490b-a80e-9b9469c53660"
authors = ["Katharine Hyatt <[email protected]>"]
version = "0.7.4"
version = "0.7.5"

[deps]
Braket = "19504a0f-b47d-4348-9127-acc6cc69ef67"
Expand All @@ -14,9 +14,9 @@ StructTypes = "856f2bd8-1eba-4b0a-8007-ebc267875bd4"

[compat]
Aqua = "=0.6"
Braket = "=0.7.4"
Braket = "=0.7.5"
CondaPkg = "=0.2.18"
DataStructures = "=0.18.13"
DataStructures = "=0.18.14"
PythonCall = "=0.9.12"
StructTypes = "=1.10.0"
julia = "1.6"
Expand Down
1 change: 1 addition & 0 deletions src/qubit_set.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ struct Qubit <: Integer
index::Int
Qubit(q::Integer) = new(q)
Qubit(q::AbstractFloat) = new(Int(q))
Qubit(q::DecFP.DecimalFloatingPoint) = new(Int(q))
Qubit(q::BigFloat) = new(Int(q))
end
Qubit(q::Qubit) = q
Expand Down
2 changes: 1 addition & 1 deletion test/integ_tests/cost_tracking.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ using AWS: @service, AWSConfig, global_aws_config
circuit = Circuit([(H, 0)])
t = Braket.Tracker()
n_available = 0
for arn = ("arn:aws:braket:eu-west-2::device/qpu/oqc/Lucy", "arn:aws:braket:us-west-1::device/qpu/rigetti/Aspen-M-2", "arn:aws:braket:::device/qpu/ionq/ionQdevice")
for arn = ("arn:aws:braket:eu-west-2::device/qpu/oqc/Lucy", "arn:aws:braket:us-west-1::device/qpu/rigetti/Aspen-M-2", "arn:aws:braket:us-east-1::device/qpu/ionq/Aria-1")
d = AwsDevice(arn)
if Braket.isavailable(d)
d(circuit, shots=10)
Expand Down
4 changes: 2 additions & 2 deletions test/integ_tests/device_creation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Braket, Test

DWAVE_ARN = "arn:aws:braket:::device/qpu/d-wave/DW_2000Q_6"
RIGETTI_ARN = "arn:aws:braket:::device/qpu/rigetti/Aspen-11"
IONQ_ARN = "arn:aws:braket:::device/qpu/ionq/ionQdevice"
IONQ_ARN = "arn:aws:braket:us-east-1::device/qpu/ionq/Aria-1"
SIMULATOR_ARN = "arn:aws:braket:::device/quantum-simulator/amazon/sv1"
OQC_ARN = "arn:aws:braket:eu-west-2::device/qpu/oqc/Lucy"

Expand Down Expand Up @@ -40,4 +40,4 @@ OQC_ARN = "arn:aws:braket:eu-west-2::device/qpu/oqc/Lucy"
end
end
end
end
end
66 changes: 34 additions & 32 deletions test/jobs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -99,39 +99,41 @@ dev_arn = "arn:aws:braket:::device/quantum-simulator/amazon/sv1"
end
end
@testset "input data handling" begin
log_streams = [Dict("logStreamName"=>"fake_name")]
events = []
resp_dict = Dict("jobArn"=>"arn:job/fake", "status"=>"COMPLETED", "instanceConfig"=>Dict("instanceCount"=>1), "logStreams"=>log_streams, "nextForwardToken"=>"0", "events"=>events, "GetCallerIdentityResult"=>Dict("Arn"=>"fake_arn", "Account"=>"000000"))
sm = joinpath(@__DIR__, "fake_code.jl")
code_loc = Braket.construct_s3_uri("fake_bucket", "fake_dir")
function f(http_backend, request, response_stream)
if request.service == "s3"
xml_str = """
<ListAllMyBucketsResult>
<Buckets>
<Bucket>
<CreationDate>2000:01:01T00:00:00</CreationDate>
<Name>"amazon-braket-fake_region-000000"</Name>
</Bucket>
</Buckets>
<Owner>
<DisplayName>"fake_name"</DisplayName>
<ID>000000</ID>
</Owner>
</ListAllMyBucketsResult>
"""
return Braket.AWS.Response(Braket.HTTP.Response(200, ["Content-Type"=>"application/xml"]), IOBuffer(xml_str))
else
return Braket.AWS.Response(Braket.HTTP.Response(200, ["Content-Type"=>"application/json"]), IOBuffer(JSON3.write(resp_dict)))
withenv("AWS_DEFAULT_REGION"=>"fake_region") do
log_streams = [Dict("logStreamName"=>"fake_name")]
events = []
resp_dict = Dict("jobArn"=>"arn:job/fake", "status"=>"COMPLETED", "instanceConfig"=>Dict("instanceCount"=>1), "logStreams"=>log_streams, "nextForwardToken"=>"0", "events"=>events, "GetCallerIdentityResult"=>Dict("Arn"=>"fake_arn", "Account"=>"000000"))
sm = joinpath(@__DIR__, "fake_code.jl")
code_loc = Braket.construct_s3_uri("fake_bucket", "fake_dir")
function f(http_backend, request, response_stream)
if request.service == "s3"
xml_str = """
<ListAllMyBucketsResult>
<Buckets>
<Bucket>
<CreationDate>2000:01:01T00:00:00</CreationDate>
<Name>"amazon-braket-fake_region-000000"</Name>
</Bucket>
</Buckets>
<Owner>
<DisplayName>"fake_name"</DisplayName>
<ID>000000</ID>
</Owner>
</ListAllMyBucketsResult>
"""
return Braket.AWS.Response(Braket.HTTP.Response(200, ["Content-Type"=>"application/xml"]), IOBuffer(xml_str))
else
return Braket.AWS.Response(Braket.HTTP.Response(200, ["Content-Type"=>"application/json"]), IOBuffer(JSON3.write(resp_dict)))
end
end
req_patch = @patch Braket.AWS._http_request(http_backend, request::Braket.AWS.Request, response_stream::IO; kwargs...) = f(http_backend, request, response_stream)
input_data = relpath(joinpath(pkgdir(Braket), "test", "fake_code.py"), @__DIR__)
apply(req_patch) do
output_dc = Braket.OutputDataConfig("s3://fake_bucket/fake_output")
checkpoint_cf = Braket.CheckpointConfig(nothing, "s3://fake_bucket/fake_checkpoints")
job = Braket.AwsQuantumJob(dev_arn, sm, entry_point="", input_data=input_data, role_arn="arn:fake:role", code_location=code_loc, hyperparameters=Dict("blah"=>1), output_data_config=output_dc, checkpoint_config=checkpoint_cf, wait_until_complete=true)
@test arn(job) == "arn:job/fake"
end
end
req_patch = @patch Braket.AWS._http_request(http_backend, request::Braket.AWS.Request, response_stream::IO) = f(http_backend, request, response_stream)
input_data = relpath(joinpath(pkgdir(Braket), "test", "fake_code.py"), @__DIR__)
apply(req_patch) do
output_dc = Braket.OutputDataConfig("s3://fake_bucket/fake_output")
checkpoint_cf = Braket.CheckpointConfig(nothing, "s3://fake_bucket/fake_checkpoints")
job = Braket.AwsQuantumJob(dev_arn, sm, entry_point="", input_data=input_data, role_arn="arn:fake:role", code_location=code_loc, hyperparameters=Dict("blah"=>1), output_data_config=output_dc, checkpoint_config=checkpoint_cf, wait_until_complete=true)
@test arn(job) == "arn:job/fake"
end
end
@testset "status" begin
Expand Down

4 comments on commit d1cd7e8

@kshyatt-aws
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/88315

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.7.5 -m "<description of version>" d1cd7e88ec56c0c0d8bade840ebbebc0c7206ffc
git push origin v0.7.5

@kshyatt-aws
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register subdir=PyBraket

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/88319

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a PyBraket-v0.7.5 -m "<description of version>" d1cd7e88ec56c0c0d8bade840ebbebc0c7206ffc
git push origin PyBraket-v0.7.5

Please sign in to comment.