Create a single JSON TCK in example options
Lots of options file in Moore save TCK-like information in two files, for example:
# temporarily save the trigger configuration to get it back when reading in the file
from Configurables import HltANNSvc
with open('hlt2_all_lines_with_reco.annsvc.selid.json', 'w') as outfile:
json.dump(HltANNSvc().Hlt2SelectionID, outfile, indent=4, sort_keys=True)
# temporarily save the PackedObjectLocations to get it back when reading in the file
with open('hlt2_all_lines_with_reco.annsvc.pol.json', 'w') as outfile:
json.dump(
HltANNSvc().PackedObjectLocations, outfile, indent=4, sort_keys=True)
There's no need spread this information around, one file is enough.
# temporarily save the trigger configuration to get it back when reading in the file
from Configurables import HltANNSvc
with open('hlt2_all_lines_with_reco.annsvc.json', 'w') as outfile:
info = dict(
Hlt2SelectionID=HltANNSvc().Hlt2SelectionID,
PackedObjectLocations=HltANNSvc().PackedObjectLocations,
)
json.dump(info, outfile, indent=4, sort_keys=True)
Because folks typically copy the configuration from examples like this it spreads this small annoyance around. We can factor out this common piece of configuration into Moore.
(I know this is not how we want TCKs to be. That issue can be discussed elsewhere.)