Closed thisac closed 3 years ago
Merging #545 (8d3eaa4) into master (57c4242) will increase coverage by
0.00%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## master #545 +/- ##
=======================================
Coverage 98.22% 98.23%
=======================================
Files 76 76
Lines 8360 8384 +24
=======================================
+ Hits 8212 8236 +24
Misses 148 148
Impacted Files | Coverage Δ | |
---|---|---|
strawberryfields/program.py | 100.00% <100.00%> (ø) |
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 57c4242...8d3eaa4. Read the comment docs.
Context:
program.compile
doesn't support device specifications with dictionary mode entries (currently only Simulon and TD2). The TD2 compilation is handled bytdmprogram.compile
, and the device spec validation works fine, while the Simulon target compilation is handled byprogram.compile
which currently will not perform any validation based on the modes entry since it is a dictionary.The current device spec mode entry for Simulon looks like this:
and is currently ignored in SF, since it's a dictionary instead of an integer.
Description of the Change: A new
assert_number_of_measurements
method is added that, similarly to what the existingassert_number_of_modes
does for integer mode entries, asserts that the program conforms to the mode entry when it contains the maximum number of allowed measurements as written in the example above.This is only run if the target is Simulon, but could easily be updated in the future if other targets will have a similar entry for modes.
Benefits: The number of measurements are checked to be below the allowed number of measurements according to the device specification for Simulon.
Possible Drawbacks: None
Related GitHub Issues: None