Skip to content

Commit

Permalink
fix: multiple taus in argparse
Browse files Browse the repository at this point in the history
Former-commit-id: 0c2bde38e73a562172d425ce822f6606390b1e9c
  • Loading branch information
Javi Ribera committed Oct 7, 2018
1 parent dd6f056 commit c5503e8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions object-locator/argparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,15 @@ def parse_command_args(training_or_testing):
args.paint = not args.no_paint

# String/Int -> List
if isinstance(args.taus, list):
if isinstance(args.taus, (list, range)):
pass
elif isinstance(args.taus, str) and ',' in args.taus:
args.taus = [float(tau) for tau in args.taus.split(',')]
args.taus = [float(tau)
for tau in args.taus.replace('[', '').replace(']', '').split(',')]
else:
args.taus = [int(args.taus)]

if isinstance(args.radii, list):
if isinstance(args.radii, (list, range)):
pass
elif isinstance(args.radii, str) and ',' in args.radii:
args.radii = [int(r) for r in args.radii.split(',')]
Expand Down

0 comments on commit c5503e8

Please sign in to comment.