Mercurial > repos > greg > validate_temperature_data
comparison validate_temperature_data.py @ 13:e33fdb18762f draft
Uploaded
author | greg |
---|---|
date | Tue, 27 Nov 2018 10:43:58 -0500 |
parents | 62b46f0b88c9 |
children | 59b9339c2ed6 |
comparison
equal
deleted
inserted
replaced
12:62b46f0b88c9 | 13:e33fdb18762f |
---|---|
145 accumulated_msgs = validate_date_string(i, date_string, accumulated_msgs) | 145 accumulated_msgs = validate_date_string(i, date_string, accumulated_msgs) |
146 doy = items[3].strip() | 146 doy = items[3].strip() |
147 accumulated_msgs = validate_integer(i, doy, accumulated_msgs, "doy") | 147 accumulated_msgs = validate_integer(i, doy, accumulated_msgs, "doy") |
148 # Make sure the DOY values are consecutive. | 148 # Make sure the DOY values are consecutive. |
149 if i==0: | 149 if i==0: |
150 try: | 150 last_doy = int(doy) |
151 last_doy = int(doy) | |
152 except Exception: | |
153 # The error for an invalid integer was captured above. | |
154 pass | |
155 else: | 151 else: |
156 try: | 152 try: |
157 if int(doy) != (last_doy + 1): | 153 if int(doy) != (last_doy + 1): |
158 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." % (i, doy)) |
159 stop_error(accumulated_msgs) | 155 stop_error(accumulated_msgs) |