@@ -1197,13 +1197,36 @@ def construct_standard_report(results, title="auto",
1197
1197
- idt_idle_oplabel : Label, optional
1198
1198
The label identifying the idle gate (for use with idle tomography).
1199
1199
1200
+ - skip_sections : tuple[str], optional
1201
+ Contains names of standard report sections that should be skipped
1202
+ in this particular report. Strings will be cast to lowercase,
1203
+ stripped of white space, and then mapped to omitted Section classes
1204
+ as follows
1205
+ {
1206
+ 'summary' : SummarySection,
1207
+ 'goodness' : GoodnessSection,
1208
+ 'colorbox' : GoodnessColorBoxPlotSection,
1209
+ 'invariantgates' : GaugeInvariantsGatesSection,
1210
+ 'invariantgerms' : GaugeInvariantsGermsSection,
1211
+ 'variant' : GaugeVariantSection,
1212
+ 'variantraw' : GaugeVariantsRawSection,
1213
+ 'variantdecomp' : GaugeVariantsDecompSection,
1214
+ 'varianterrorgen' : GaugeVariantsErrorGenSection,
1215
+ 'input' : InputSection,
1216
+ 'meta' : MetaSection,
1217
+ 'help' : HelpSection
1218
+ }
1219
+
1220
+ A KeyError will be raised if skip_sections contains a string
1221
+ that is not in the keys of the above dict (after casting to
1222
+ lower case and stripping white space).
1223
+
1200
1224
verbosity : int, optional
1201
1225
How much detail to send to stdout.
1202
1226
1203
1227
Returns
1204
1228
-------
1205
- Workspace
1206
- The workspace object used to create the report
1229
+ Report
1207
1230
"""
1208
1231
1209
1232
printer = _VerbosityPrinter .create_printer (verbosity , comm = comm )
@@ -1265,20 +1288,30 @@ def construct_standard_report(results, title="auto",
1265
1288
flags .add ('CombineRobust' )
1266
1289
1267
1290
# build section list
1268
- sections = [
1269
- _section .SummarySection (),
1270
- _section .GoodnessSection (),
1271
- _section .GoodnessColorBoxPlotSection (),
1272
- _section .GaugeInvariantsGatesSection (),
1273
- _section .GaugeInvariantsGermsSection (),
1274
- _section .GaugeVariantSection (),
1275
- _section .GaugeVariantsRawSection (),
1276
- _section .GaugeVariantsDecompSection (),
1277
- _section .GaugeVariantsErrorGenSection (),
1278
- _section .InputSection (),
1279
- _section .MetaSection (),
1280
- _section .HelpSection ()
1281
- ]
1291
+ possible_sections = {
1292
+ 'summary' : _section .SummarySection (),
1293
+ 'goodness' : _section .GoodnessSection (),
1294
+ 'colorbox' : _section .GoodnessColorBoxPlotSection (),
1295
+ 'invariantgates' : _section .GaugeInvariantsGatesSection (),
1296
+ 'invariantgerms' : _section .GaugeInvariantsGermsSection (),
1297
+ 'variant' : _section .GaugeVariantSection (),
1298
+ 'variantraw' : _section .GaugeVariantsRawSection (),
1299
+ 'variantdecomp' : _section .GaugeVariantsDecompSection (),
1300
+ 'varianterrorgen' : _section .GaugeVariantsErrorGenSection (),
1301
+ 'input' : _section .InputSection (),
1302
+ 'meta' : _section .MetaSection (),
1303
+ 'help' : _section .HelpSection ()
1304
+ }
1305
+
1306
+ skip_sections = advanced_options .get ('skip_sections' , tuple ())
1307
+ if skip_sections :
1308
+ if isinstance (skip_sections , str ):
1309
+ skip_sections = [skip_sections ]
1310
+ skip_sections = [s .lower ().replace (' ' ,'' ) for s in skip_sections ]
1311
+ for s in skip_sections :
1312
+ possible_sections .pop (s )
1313
+ sections = list (possible_sections .values ())
1314
+ # ^ This whole process won't affect ordering of objects in "sections".
1282
1315
1283
1316
if 'ShowScaling' in flags :
1284
1317
sections .append (_section .GoodnessScalingSection ())
0 commit comments