diff 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
line wrap: on
line diff
--- a/python/pavement.py	Tue Mar 24 14:17:12 2015 +0100
+++ b/python/pavement.py	Tue Mar 24 18:11:28 2015 +0100
@@ -164,14 +164,14 @@
             else:
                 tmin = None
             if weatherDatatype == 'ec':
-                if data['pluie_tot'][i] != None and not np.isnan(data['pluie_tot'][i]):
+                if data['pluie_tot'][i] is not None and not np.isnan(data['pluie_tot'][i]):
                     pluie_tot  += data['pluie_tot'][i]
-                if data['neige_tot'][i] != None and not np.isnan(data['neige_tot'][i]):
+                if data['neige_tot'][i] is not None and not np.isnan(data['neige_tot'][i]):
                     neige_tot  += data['neige_tot'][i]
-            if tmax != None:
+            if tmax is not None:
                 if tmax < 0:
                     nbre_jours_T_negatif += 1
-            if tmax != None and tmin != None:
+            if tmax is not None and tmin is not None:
                 if tmax > 0 and tmin < 0:
                     nbre_jours_gel_degel += 1
                 for l in range(len(seuils_T)):
@@ -179,7 +179,7 @@
                         deltas_T[l] += 1
             if not np.isnan(data['tmoy'][i]):
                 tmoys.append(data['tmoy'][i])
-            if tmax != None:
+            if tmax is not None:
                 if tmax < 0:
                     compteur += 1
                 elif tmax >= 0 and compteur >= nbre_jours_gel_consecutifs:
@@ -296,7 +296,7 @@
         measure variation, initial measure, time duration, lane position2, weather indicators
         ...'''
         variationData = []
-        if lanePositions == None:
+        if lanePositions is None:
             nonZeroIndices = ~np.isnan(self.data[dataLabel])
             days = self.data[nonZeroIndices]['jours']
             dates = self.data[nonZeroIndices]['date_mesure']