comparison validate_temperature_data.py @ 16:304b46e9a34b draft

Uploaded
author greg
date Tue, 27 Nov 2018 10:57:30 -0500
parents 13de3d5839ac
children bcbdc7f7aa7a
comparison
equal deleted inserted replaced
15:13de3d5839ac 16:304b46e9a34b
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 == 1: 149 if i == 1:
150 try: 150 last_doy = int(doy)
151 last_doy = int(doy)
152 except Exception:
153 pass
154 else: 151 else:
155 try: 152 try:
156 if int(doy) != (last_doy + 1): 153 if int(doy) != (last_doy + 1):
157 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))
158 stop_error(accumulated_msgs) 155 stop_error(accumulated_msgs)