Mercurial Hosting > traffic-intelligence
comparison python/pavement.py @ 998:933670761a57
updated code to python 3 (tests pass and scripts run, but non-executed parts of code are probably still not correct)
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Sun, 27 May 2018 23:22:48 -0400 |
parents | 15e244d2a1b5 |
children |
comparison
equal
deleted
inserted
replaced
997:4f3387a242a1 | 998:933670761a57 |
---|---|
32 70: "Acces isolees", | 32 70: "Acces isolees", |
33 99: "Autres"} | 33 99: "Autres"} |
34 | 34 |
35 def caracteristiques(rtss, maintenanceLevel, rtssWeatherStation, fmr, paintType): | 35 def caracteristiques(rtss, maintenanceLevel, rtssWeatherStation, fmr, paintType): |
36 '''Computes characteristic data for the RTSS (class rtss) | 36 '''Computes characteristic data for the RTSS (class rtss) |
37 maintenanceLevel = pylab.csv2rec('C:\Users\Alexandre\Desktop\Projet_maitrise_recherche\BDD_access\\analyse_donnees_deneigement\\exigence_circuits.txt', delimiter = ';') | 37 maintenanceLevel = pylab.csv2rec('C:\\Users\Alexandre\Desktop\Projet_maitrise_recherche\BDD_access\\analyse_donnees_deneigement\\exigence_circuits.txt', delimiter = ';') |
38 rtssWeatherStation = pylab.csv2rec('C:\Users\Alexandre\Desktop\Projet_maitrise_recherche\stations_environnement_canada\\rtssWeatherStation\juste_pour_rtss_avec_donnees_entretien_hiv\\rtssWeatherStation_EC3.txt', delimiter = ',') | 38 rtssWeatherStation = pylab.csv2rec('C:\\Users\Alexandre\Desktop\Projet_maitrise_recherche\stations_environnement_canada\\rtssWeatherStation\juste_pour_rtss_avec_donnees_entretien_hiv\\rtssWeatherStation_EC3.txt', delimiter = ',') |
39 fmr = pylab.csv2rec('C:\Users\Alexandre\Desktop\Projet_maitrise_recherche\BDD_access\\analyse_donnees_deneigement\\fmr.txt', delimiter = ';') | 39 fmr = pylab.csv2rec('C:\\Users\Alexandre\Desktop\Projet_maitrise_recherche\BDD_access\\analyse_donnees_deneigement\\fmr.txt', delimiter = ';') |
40 paintType = pylab.csv2rec('C:\Users\Alexandre\Desktop\Projet_maitrise_recherche\BDD_access\\analyse_donnees_deneigement\\type_peinture.txt', delimiter = ';') | 40 paintType = pylab.csv2rec('C:\\Users\Alexandre\Desktop\Projet_maitrise_recherche\BDD_access\\analyse_donnees_deneigement\\type_peinture.txt', delimiter = ';') |
41 ''' | 41 ''' |
42 # determination exigence deneigement | 42 # determination exigence deneigement |
43 if rtss.id in maintenanceLevel['rtss_debut']: | 43 if rtss.id in maintenanceLevel['rtss_debut']: |
44 for i in range(len(maintenanceLevel)): | 44 for i in range(len(maintenanceLevel)): |
45 if maintenanceLevel['rtss_debut'][i] == rtss.id: | 45 if maintenanceLevel['rtss_debut'][i] == rtss.id: |
101 | 101 |
102 return (exigence, x_moy, y_moy, age_revtm, classe_fonct, type_revtm, milieu, djma, djma_camions, vit_max, peinture_lrd, peinture_lrg, peinture_lc) | 102 return (exigence, x_moy, y_moy, age_revtm, classe_fonct, type_revtm, milieu, djma, djma_camions, vit_max, peinture_lrd, peinture_lrg, peinture_lc) |
103 | 103 |
104 def winterMaintenanceIndicators(data, startDate, endDate, circuitReference, snowThreshold): | 104 def winterMaintenanceIndicators(data, startDate, endDate, circuitReference, snowThreshold): |
105 '''Computes several winter maintenance indicators | 105 '''Computes several winter maintenance indicators |
106 data = entretien_hivernal = pylab.csv2rec('C:\Users\Alexandre\Documents\Cours\Poly\Projet\mesures_entretien_hivernal\mesures_deneigement.txt', delimiter = ',')''' | 106 data = entretien_hivernal = pylab.csv2rec('C:\\Users\Alexandre\Documents\Cours\Poly\Projet\mesures_entretien_hivernal\mesures_deneigement.txt', delimiter = ',')''' |
107 import datetime | 107 import datetime |
108 somme_eau, somme_neige, somme_abrasif, somme_sel, somme_lc, somme_lrg, somme_lrd, compteur_premiere_neige, compteur_somme_abrasif = 0,0,0,0,0,0,0,0,0 | 108 somme_eau, somme_neige, somme_abrasif, somme_sel, somme_lc, somme_lrg, somme_lrd, compteur_premiere_neige, compteur_somme_abrasif = 0,0,0,0,0,0,0,0,0 |
109 | 109 |
110 if circuitReference in data['ref_circuit']: | 110 if circuitReference in data['ref_circuit']: |
111 for i in range(len(data)): | 111 for i in range(len(data)): |