comparison python/pavement.py @ 636:3058e00887bc

removed all issues because of tests with None, using is instead of == or !=
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Tue, 24 Mar 2015 18:11:28 +0100
parents 7978b286fcfa
children 15e244d2a1b5
comparison
equal deleted inserted replaced
635:6ae68383071e 636:3058e00887bc
162 if not np.isnan(data['tmin'][i]): 162 if not np.isnan(data['tmin'][i]):
163 tmin = data['tmin'][i] 163 tmin = data['tmin'][i]
164 else: 164 else:
165 tmin = None 165 tmin = None
166 if weatherDatatype == 'ec': 166 if weatherDatatype == 'ec':
167 if data['pluie_tot'][i] != None and not np.isnan(data['pluie_tot'][i]): 167 if data['pluie_tot'][i] is not None and not np.isnan(data['pluie_tot'][i]):
168 pluie_tot += data['pluie_tot'][i] 168 pluie_tot += data['pluie_tot'][i]
169 if data['neige_tot'][i] != None and not np.isnan(data['neige_tot'][i]): 169 if data['neige_tot'][i] is not None and not np.isnan(data['neige_tot'][i]):
170 neige_tot += data['neige_tot'][i] 170 neige_tot += data['neige_tot'][i]
171 if tmax != None: 171 if tmax is not None:
172 if tmax < 0: 172 if tmax < 0:
173 nbre_jours_T_negatif += 1 173 nbre_jours_T_negatif += 1
174 if tmax != None and tmin != None: 174 if tmax is not None and tmin is not None:
175 if tmax > 0 and tmin < 0: 175 if tmax > 0 and tmin < 0:
176 nbre_jours_gel_degel += 1 176 nbre_jours_gel_degel += 1
177 for l in range(len(seuils_T)): 177 for l in range(len(seuils_T)):
178 if tmax - tmin >=seuils_T[l]: 178 if tmax - tmin >=seuils_T[l]:
179 deltas_T[l] += 1 179 deltas_T[l] += 1
180 if not np.isnan(data['tmoy'][i]): 180 if not np.isnan(data['tmoy'][i]):
181 tmoys.append(data['tmoy'][i]) 181 tmoys.append(data['tmoy'][i])
182 if tmax != None: 182 if tmax is not None:
183 if tmax < 0: 183 if tmax < 0:
184 compteur += 1 184 compteur += 1
185 elif tmax >= 0 and compteur >= nbre_jours_gel_consecutifs: 185 elif tmax >= 0 and compteur >= nbre_jours_gel_consecutifs:
186 nbre_jours_gel_consecutifs = compteur 186 nbre_jours_gel_consecutifs = compteur
187 compteur = 0 187 compteur = 0
294 lanePositions = list of integers (range(1,7)) 294 lanePositions = list of integers (range(1,7))
295 measure variation, initial measure, time duration, lane position1, weather indicators 295 measure variation, initial measure, time duration, lane position1, weather indicators
296 measure variation, initial measure, time duration, lane position2, weather indicators 296 measure variation, initial measure, time duration, lane position2, weather indicators
297 ...''' 297 ...'''
298 variationData = [] 298 variationData = []
299 if lanePositions == None: 299 if lanePositions is None:
300 nonZeroIndices = ~np.isnan(self.data[dataLabel]) 300 nonZeroIndices = ~np.isnan(self.data[dataLabel])
301 days = self.data[nonZeroIndices]['jours'] 301 days = self.data[nonZeroIndices]['jours']
302 dates = self.data[nonZeroIndices]['date_mesure'] 302 dates = self.data[nonZeroIndices]['date_mesure']
303 measures = self.data[nonZeroIndices][dataLabel] 303 measures = self.data[nonZeroIndices][dataLabel]
304 for i in range(1, len(dates)): 304 for i in range(1, len(dates)):