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