Overriding options in davinci script depends on order of special flag overwrite_data_options
Bug easy to reproduce with the following command line
davinci --export bla.opts --dry-run run-mc --overwrite_data_options True --data_type Upgrade --inputfiledb Upgrade_Bd2KstarMuMu_ldst Phys/DaVinci/options/DaVinciDB-Example.yaml
as is or swapping the order of the 2 options to --data_type Upgrade --overwrite_data_options True
. The former works whereas the latter doesn't.
The fix seems very easy - make sure to first check for --overwrite_data_options
in the set of Click context arguments and prepend it to the list (removing it from where it is found in the list).
Totally related, the resulting exception thrown in by code in Phys/DaVinci/python/DaVinci/configOptions.py
uses in a couple of places 'OverwriteDataOptions'
rather than 'overwrite_data_options'
, which would be more consistent.
BTW, maybe one should rename overwrite to override while at it?