diff trafficintelligence/pavement.py @ 1112:956a66096e91

removed code now available in simulation project, and issue with deprecated find function in matplotlib
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Wed, 05 Jun 2019 13:12:10 -0400
parents c6cf75a2ed08
children 785c86013d2c
line wrap: on
line diff
--- a/trafficintelligence/pavement.py	Mon May 06 17:13:13 2019 -0400
+++ b/trafficintelligence/pavement.py	Wed Jun 05 13:12:10 2019 -0400
@@ -143,13 +143,12 @@
 
     weatherDataType is to indicate Environnement Canada data ('ec') or else MTQ
     minProportionMeasures is proportion of measures necessary to consider the indicators'''
-    from matplotlib.mlab import find
     nbre_jours_T_negatif,nbre_jours_gel_degel,pluie_tot,neige_tot,ecart_type_T = 0,0,0,0,0
     compteur,nbre_jours_gel_consecutifs=0,0
     tmoys = []
     seuils_T = [20,15,10,5]
     deltas_T = [0,0,0,0]
-    startIndex = find(data['date'] == startDate)
+    startIndex = np.nonzero(data['date'] == startDate)
     nDays = int((endDate - startDate).days)+1
     if len(startIndex) > 0 and startIndex+nDays <= len(data):
         startIndex = startIndex[0]
@@ -202,13 +201,12 @@
 
 def mtqWeatherIndicators(data, startDate, endDate,tmax,tmin,tmoy):
     print("Deprecated, use weatherIndicators")
-    from matplotlib.mlab import find
     nbre_jours_T_negatif,nbre_jours_gel_degel,ecart_type_T = 0,0,0
     compteur,nbre_jours_gel_consecutifs=0,0
     tmoys = []
     seuils_T = [20,15,10,5]
     deltas_T = [0,0,0,0]
-    startIndex = find(data['date'] == startDate)
+    startIndex = np.nonzero(data['date'] == startDate)
     nDays = (endDate - startDate).days+1
     for i in range(startIndex, startIndex+nDays):
         if tmax[i] < 0: