Mercurial > repos > greg > validate_temperature_data
comparison validate_temperature_data.py @ 12:62b46f0b88c9 draft
Uploaded
| author | greg |
|---|---|
| date | Tue, 27 Nov 2018 10:41:19 -0500 |
| parents | f0d173b1abcf |
| children | e33fdb18762f |
comparison
equal
deleted
inserted
replaced
| 11:f0d173b1abcf | 12:62b46f0b88c9 |
|---|---|
| 67 pass | 67 pass |
| 68 return add_error_msg(accumulated_msgs, "Line %d contains an incorrect date format (%s must be mm-dd)." % (line_no, mmdd)) | 68 return add_error_msg(accumulated_msgs, "Line %d contains an incorrect date format (%s must be mm-dd)." % (line_no, mmdd)) |
| 69 | 69 |
| 70 | 70 |
| 71 accumulated_msgs = "" | 71 accumulated_msgs = "" |
| 72 last_doy = 0 | |
| 72 # Parse the input file, skipping the header, and validating | 73 # Parse the input file, skipping the header, and validating |
| 73 # that each data line consists of 31 comma-separated items. | 74 # that each data line consists of 31 comma-separated items. |
| 74 if args.data_type == "normals": | 75 if args.data_type == "normals": |
| 75 input_file = args.input_normals | 76 input_file = args.input_normals |
| 76 last_doy = 0 | |
| 77 num_normals_rows = 0 | 77 num_normals_rows = 0 |
| 78 else: | 78 else: |
| 79 input_file = args.input_actuals | 79 input_file = args.input_actuals |
| 80 with open(input_file, "r") as ih: | 80 with open(input_file, "r") as ih: |
| 81 for i, line in enumerate(ih): | 81 for i, line in enumerate(ih): |
