Adjust Handling of Mutually Exclusive Arguments
This MR is designed to resolve #310. In python 3.12, it would seem something has changed about the argument parsing and the mutually exclusive groups that contain nonestr
arguments are noted as conflicting when string None is set, as in the case of the complete config file produced by all bilby_pipe
runs which causes the parser to raise an ArgumentError
exception during _parse_known_args
and consequently terminate bilby_pipe
. To address that, this MR does the following:
- Removes the mutually exclusive groups for arguments involving
nonestr
. - Instead a dictionary with keys being the group names and values being a list of the keys that are exclusive in that group is given to the
BilbyArgParser
class. - This list is then used to check that these arguments are non-conflicting, i.e. that at least one of them is at default value.
- This approach avoids nesting groups in the parser in the way that the original commits of the MR did, which is deprecated behaviour after Python 3.11.
Edited by Mick Wright