test.py 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. import sys
  2. import os
  3. import re
  4. import pandas as pd
  5. sys.path.append("/home/vangogh/software/FuzzScene/code/")
  6. import Constants
  7. operator_flag = sys.argv[1]
  8. radar_rand_time = sys.argv[2]
  9. seed_num = sys.argv[3]
  10. model_num = sys.argv[4]
  11. clear_output = sys.argv[5]
  12. print("[" + os.path.basename(__file__) + ", Line " + str(sys._getframe().f_lineno) + ", " + sys._getframe().f_code.co_name + "] " + "operator_flag: " + operator_flag + ", radar_rand_time: " + radar_rand_time + ", seed_num: " + seed_num + ", model_num: " + model_num + ", clear_output: " + clear_output)
  13. # if os.path.exists('./error_count.csv'): # clear ./error_count.csv
  14. # os.remove('./error_count.csv')
  15. # shutil.copy('./error_count_null.csv', './error_count.csv')
  16. f = open(Constants.CONSTANTS_PATH, "r+")
  17. new = []
  18. for line in f:
  19. new.append(line)
  20. f.close()
  21. new[1] = 'OPERATOR_FLAG = ' + operator_flag + '\n'
  22. new[2] = 'RADAR_RAND_TIME = ' + radar_rand_time + '\n'
  23. new[3] = 'SEED_NUM = ' + seed_num + '\n'
  24. new[4] = 'MODEL_NUM = ' + model_num + '\n'
  25. new[5] = 'CLEAR_OUTPUT = ' + clear_output + '\n'
  26. f = open(Constants.CONSTANTS_PATH, "w+")
  27. for n in new:
  28. f.write(n)
  29. f.close()