|
@ -1,8 +1,9 @@ |
|
|
from tkinter import * |
|
|
from tkinter import * |
|
|
|
|
|
|
|
|
def lancer(): |
|
|
def lancer(date, temp_moy, temp_ref): |
|
|
lecture("pic-journalier-consommation.csv") |
|
|
moyenne_liste() |
|
|
kPlusProches(value1, donnees_point,temp_jour) |
|
|
donnees_point = [date, temp_moy, temp_ref] |
|
|
|
|
|
kPlusProches(k, donnees_point,temp_num_jour) |
|
|
estBissextile(an) |
|
|
estBissextile(an) |
|
|
|
|
|
|
|
|
def lecture(fichier): |
|
|
def lecture(fichier): |
|
@ -84,7 +85,7 @@ def numeroJour(date): |
|
|
return num_jour |
|
|
return num_jour |
|
|
|
|
|
|
|
|
def moyenne_liste(): |
|
|
def moyenne_liste(): |
|
|
temp_jour, = lecture("pic-journalier-consommation.csv") |
|
|
temp_jour = lecture("pic-journalier-consommation.csv") |
|
|
temp_num_jour = [] |
|
|
temp_num_jour = [] |
|
|
for i in range(365): |
|
|
for i in range(365): |
|
|
temp_jour[i][0] = numeroJour(temp_jour[i][0]) |
|
|
temp_jour[i][0] = numeroJour(temp_jour[i][0]) |
|
@ -104,6 +105,7 @@ def moyenne_liste(): |
|
|
moy_conso += lst_conso[n] |
|
|
moy_conso += lst_conso[n] |
|
|
moy_temp_moy += lst_temp_moy[n] |
|
|
moy_temp_moy += lst_temp_moy[n] |
|
|
moy_temp_ref += lst_temp_ref[n] |
|
|
moy_temp_ref += lst_temp_ref[n] |
|
|
|
|
|
print(lst_conso) |
|
|
moy_conso = moy_conso / len(lst_conso) |
|
|
moy_conso = moy_conso / len(lst_conso) |
|
|
moy_temp_moy = moy_temp_moy / len(lst_temp_moy) |
|
|
moy_temp_moy = moy_temp_moy / len(lst_temp_moy) |
|
|
moy_temp_ref = moy_temp_ref / len(lst_temp_ref) |
|
|
moy_temp_ref = moy_temp_ref / len(lst_temp_ref) |
|
@ -121,25 +123,29 @@ def distance(temp_jour, donneespoint): |
|
|
return dist |
|
|
return dist |
|
|
|
|
|
|
|
|
def PuissanceMoyenne(lst,distance): |
|
|
def PuissanceMoyenne(lst,distance): |
|
|
"""Fonction qui calcule la moyenne de distances entre les points """ |
|
|
"""Calcule la moyenne de distances entre les points """ |
|
|
lecture("pic-journalier-consommation.csv") |
|
|
lecture("pic-journalier-consommation.csv") |
|
|
moy = sum() / len() |
|
|
moy = sum() / len() |
|
|
|
|
|
|
|
|
def recup1(): |
|
|
def recup1(): |
|
|
voisins = value1.get() |
|
|
k = value1.get() |
|
|
label5.configure(text=voisins) |
|
|
label5.configure(text=k) |
|
|
|
|
|
return k |
|
|
|
|
|
|
|
|
def recup2(): |
|
|
def recup2(): |
|
|
date = value2.get() |
|
|
date = value2.get() |
|
|
label6.configure(text=date) |
|
|
label6.configure(text=date) |
|
|
|
|
|
return date |
|
|
|
|
|
|
|
|
def recup3(): |
|
|
def recup3(): |
|
|
temp_moy = value3.get() |
|
|
temp_moy = value3.get() |
|
|
label6.configure(text=temp_moy) |
|
|
label6.configure(text=temp_moy) |
|
|
|
|
|
return temp_moy |
|
|
|
|
|
|
|
|
def recup4(): |
|
|
def recup4(): |
|
|
temp_ref = value4.get() |
|
|
temp_ref = value4.get() |
|
|
label6.configure(text=temp_ref) |
|
|
label6.configure(text=temp_ref) |
|
|
|
|
|
return temp_ref |
|
|
|
|
|
|
|
|
#def calc_conso(): |
|
|
#def calc_conso(): |
|
|
# Conso = |
|
|
# Conso = |
|
@ -179,7 +185,7 @@ entree4.grid() |
|
|
|
|
|
|
|
|
label8 = Label(fenetre, text="Conso", bg="yellow") |
|
|
label8 = Label(fenetre, text="Conso", bg="yellow") |
|
|
|
|
|
|
|
|
bouton1 = Button(canvas1, text="Tester", command=lancer(), width=15, height=2, bg="cyan").grid(pady=10) |
|
|
bouton1 = Button(canvas1, text="Tester", command=lancer(value2.get, value3.get, value4.get), width=15, height=2, bg="cyan").grid(pady=10) |
|
|
|
|
|
|
|
|
canvas1.grid() |
|
|
canvas1.grid() |
|
|
label8.grid(pady=10) |
|
|
label8.grid(pady=10) |
|
|