XanaduAI / strawberryfields

Strawberry Fields is a full-stack Python library for designing, simulating, and optimizing continuous variable (CV) quantum optical circuits.
https://strawberryfields.ai
Apache License 2.0
754 stars 191 forks source link

Fixing kwarg assignment bug in engine.py #341

Closed co9olguy closed 4 years ago

co9olguy commented 4 years ago

Description of the Change: In #337 the signature of the RemoteEngine was updated. In particular, it should accept a shots keyword argument. However, there was a bug where kwargs was updated, but then reassigned to the result of kwargs.update (which is None). This resulted in the shots not being added to the blackbird scripts which are sent for remote execution. Jobs were summarily rejected.

Benefits: This PR fixes the above bug

Possible Drawbacks: We need to add a test which would have detected this bug before merging.

Related GitHub Issues: PR #337

codecov[bot] commented 4 years ago

Codecov Report

Merging #341 into master will not change coverage by %. The diff coverage is 97.67%.

@@           Coverage Diff           @@
##           master     #341   +/-   ##
=======================================
  Coverage   97.70%   97.70%           
=======================================
  Files          51       51           
  Lines        6354     6354           
=======================================
  Hits         6208     6208           
  Misses        146      146           
Impacted Files Coverage Δ
strawberryfields/api/job.py 93.02% <ø> (ø)
strawberryfields/io.py 98.78% <66.66%> (ø)
strawberryfields/api/connection.py 97.70% <100.00%> (ø)
strawberryfields/apps/sample.py 100.00% <100.00%> (ø)
strawberryfields/circuitspecs/X12.py 100.00% <100.00%> (ø)
strawberryfields/circuitspecs/X8.py 100.00% <100.00%> (ø)
strawberryfields/circuitspecs/__init__.py 100.00% <100.00%> (ø)
strawberryfields/engine.py 95.33% <100.00%> (ø)
strawberryfields/program.py 98.84% <100.00%> (ø)
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 2b5a89e...202a96e. Read the comment docs.