Changes in benchmark/rmit.py [883c4d9:836c9925]
- File:
-
- 1 edited
-
benchmark/rmit.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
benchmark/rmit.py
r883c4d9 r836c9925 12 12 import datetime 13 13 import itertools 14 import json15 14 import os 16 15 import random … … 118 117 # ================================================================================ 119 118 # parse command line arguments 120 formats = ['raw', 'csv' , 'json']119 formats = ['raw', 'csv'] 121 120 parser = argparse.ArgumentParser(description='Python Script to implement R.M.I.T. testing : Randomized Multiple Interleaved Trials') 122 121 parser.add_argument('--list', help='List all the commands that would be run', action='store_true') 123 parser.add_argument('--format', help='How to print the result', choices=formats, default=' json')122 parser.add_argument('--format', help='How to print the result', choices=formats, default='csv') 124 123 parser.add_argument('--file', nargs='?', type=argparse.FileType('w'), default=sys.stdout) 125 124 parser.add_argument('-t', '--trials', help='Number of trials to run per combinaison', type=int, default=3) … … 204 203 205 204 # ================================================================================ 206 # Print raw205 # Print csv 207 206 if options.format == 'raw': 208 207 for r in result: 209 208 print(r, file=options.file) 210 sys.exit(0)211 212 # ================================================================================213 # Print json214 if options.format == 'json':215 json.dump(result, options.file)216 209 sys.exit(0) 217 210
Note:
See TracChangeset
for help on using the changeset viewer.