Parse float and fractions using argument parser.
(x)
| 61 | raise argparse.ArgumentTypeError('Boolean value expected.') |
| 62 | |
| 63 | def str2float(x): |
| 64 | """ |
| 65 | Parse float and fractions using argument parser. |
| 66 | """ |
| 67 | if '/' in x: |
| 68 | n, d = x.split('/') |
| 69 | return float(n)/float(d) |
| 70 | else: |
| 71 | try: |
| 72 | return float(x) |
| 73 | except: |
| 74 | raise argparse.ArgumentTypeError('Fraction or float value expected.') |
| 75 | |
| 76 | |
| 77 | def format_time(elapsed): |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…