Mercurial > repos > greg > validate_temperature_data
comparison validate_temperature_data.py @ 17:bcbdc7f7aa7a draft default tip
Uploaded
author | greg |
---|---|
date | Tue, 27 Nov 2018 11:02:04 -0500 |
parents | 304b46e9a34b |
children |
comparison
equal
deleted
inserted
replaced
16:304b46e9a34b | 17:bcbdc7f7aa7a |
---|---|
113 doy = items[7].strip() | 113 doy = items[7].strip() |
114 accumulated_msgs = validate_integer(i, doy, accumulated_msgs, "doy") | 114 accumulated_msgs = validate_integer(i, doy, accumulated_msgs, "doy") |
115 # Make sure the DOY values are consecutive. | 115 # Make sure the DOY values are consecutive. |
116 try: | 116 try: |
117 if int(doy) != (last_doy + 1): | 117 if int(doy) != (last_doy + 1): |
118 accumulated_msgs = add_error_msg(accumulated_msgs, "Line %d contains a DOY (%s) that is not conexcutive." % (i, doy)) | 118 accumulated_msgs = add_error_msg(accumulated_msgs, "Line %d contains a DOY (%s) that is not conexcutive (previous DOY is %d)." % (i, doy, last_doy)) |
119 stop_error(accumulated_msgs) | 119 stop_error(accumulated_msgs) |
120 else: | 120 else: |
121 last_doy += 1 | 121 last_doy += 1 |
122 except Exception: | 122 except Exception: |
123 # The error for an invalid integer was captured above. | 123 # The error for an invalid integer was captured above. |
149 if i == 1: | 149 if i == 1: |
150 last_doy = int(doy) | 150 last_doy = int(doy) |
151 else: | 151 else: |
152 try: | 152 try: |
153 if int(doy) != (last_doy + 1): | 153 if int(doy) != (last_doy + 1): |
154 accumulated_msgs = add_error_msg(accumulated_msgs, "Line %d contains a DOY (%s) that is not conexcutive." % (i, doy)) | 154 accumulated_msgs = add_error_msg(accumulated_msgs, "Line %d contains a DOY (%s) that is not conexcutive (previous DOY is %d)." % (i, doy, last_doy)) |
155 stop_error(accumulated_msgs) | 155 stop_error(accumulated_msgs) |
156 else: | |
157 last_doy += 1 | |
156 except Exception: | 158 except Exception: |
157 # The error for an invalid integer was captured above. | 159 # The error for an invalid integer was captured above. |
158 pass | 160 pass |
159 last_doy += 1 | |
160 tmin = items[4].strip() | 161 tmin = items[4].strip() |
161 accumulated_msgs = validate_decimal(i, tmin, accumulated_msgs, "tmin") | 162 accumulated_msgs = validate_decimal(i, tmin, accumulated_msgs, "tmin") |
162 tmax = items[5].strip() | 163 tmax = items[5].strip() |
163 accumulated_msgs = validate_decimal(i, tmax, accumulated_msgs, "tmax") | 164 accumulated_msgs = validate_decimal(i, tmax, accumulated_msgs, "tmax") |
164 if args.data_type == "normals" and num_normals_rows != 367: | 165 if args.data_type == "normals" and num_normals_rows != 367: |