Skip to content
Snippets Groups Projects
Commit 02ae1d5c authored by Sebastien Ponce's avatar Sebastien Ponce
Browse files

Merge branch 'pyconf-simulation-flag-must-be-explicitly-set' into 'master'

PyConf: Require options.simulation flag to be explicitly set by user to True or False

See merge request !4073
parents 32b0f0bc b7c372a6
No related branches found
No related tags found
1 merge request!4073PyConf: Require options.simulation flag to be explicitly set by user to True or False
Pipeline #5445393 passed
......@@ -77,6 +77,7 @@ options.input_type = "NONE"
options.dddb_tag = "dummy"
options.conddb_tag = "dummy"
options.write_decoding_keys_to_git = False
options.simulation = False
config2 = configure_input(options)
config = configure(options, moore)
......@@ -75,6 +75,7 @@ options.monitoring_file = "monitoring.json"
options.input_type = "NONE"
options.dddb_tag = "dummy"
options.conddb_tag = "dummy"
options.simulation = False
config2 = configure_input(options)
config = configure(options, line1)
......@@ -22,6 +22,7 @@ options.evt_max = 10
options.input_type = "NONE"
options.dddb_tag = "dummy"
options.conddb_tag = "dummy"
options.simulation = False
# Enable the NameAuditor
options.auditors = ["NameAuditor"]
......
......@@ -303,7 +303,7 @@ class ApplicationOptions(ConfigurableUser):
'conddb_tag': '',
'geometry_version': '',
'conditions_version': '',
'simulation': True,
'simulation': None,
# output related
'output_file': '',
'output_type': '',
......@@ -383,6 +383,12 @@ class ApplicationOptions(ConfigurableUser):
required.extend(["geometry_version", "conditions_version"]
if UseDD4Hep else ["dddb_tag", "conddb_tag"])
# Check simulation flag has been explicitly set
if not self.isPropertySet("simulation"):
raise ConfigurationError(
"Required option simulation must be set to True or False as appropriate"
)
if UseDD4Hep:
if not self.geometry_version and self.dddb_tag:
log.warning(
......
......@@ -17,5 +17,6 @@ from PyConf.Algorithms import (Gaudi__Examples__IntDataProducer as
cf = CompositeNode("top", children=[IntDataProducer()], force_order=True)
options = ApplicationOptions(_enabled=False)
options.simulation = False
config = configure(options, cf)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment