PCLoc icon indicating copy to clipboard operation
PCLoc copied to clipboard

Bug: --opt_div_matching always evaluates to True

Open Shubodh opened this issue 2 years ago • 1 comments

Usage of arg parser for --opt_div_matching is wrong in the code.

It's a string which always evaluates to True here irrespective of keyword provided, will only evaluate to False if the argument is empty. Rewrite it to something like below code:

parser.add_argument('--my-flag',choices=('True','False'))
arguments = parser.parse_args()
MyFlag = arguments.my_flag == 'True'

instead of

parser.add_argument('--opt_div_matching', default=True, help='True: Divided matching, False: base matching')
if args.opt_div_matching:
    refinement = Refinement_extended(superglue)
else:
    refinement = Refinement_base(superglue)

Source

Shubodh avatar Apr 21 '22 15:04 Shubodh