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
737 stars 188 forks source link

Validate parameters fix #711

Closed thisac closed 2 years ago

thisac commented 2 years ago

Context: TDM programs sometimes uses arrays instead of single parameter values causing issues when calling the Device.validate_parameter method.

Description of the Change:

Benefits: Device.validate_parameter works with arbitrarily nested parameter arrays.

Possible Drawbacks: None

Related GitHub Issues: None

codecov[bot] commented 2 years ago

Codecov Report

Merging #711 (28e501f) into master (9033843) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #711   +/-   ##
=======================================
  Coverage   98.72%   98.72%           
=======================================
  Files          75       75           
  Lines        9230     9238    +8     
=======================================
+ Hits         9112     9120    +8     
  Misses        118      118           
Impacted Files Coverage Δ
strawberryfields/device.py 97.46% <100.00%> (+0.28%) :arrow_up:

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 9033843...28e501f. Read the comment docs.