Skip to content
Extraits de code Groupes Projets
Valider 0e0e6708 rédigé par Rémi - Le Filament's avatar Rémi - Le Filament
Parcourir les fichiers

[FIX] export when no curve type defined

parent 63f75568
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -99,33 +99,37 @@ def make_cons_data(energy_dict):
# horodatage
period.strftime("%d/%m/%Y %H:%M"),
# consommation en kwh
str(round(energy_dict[period]["cons"], rounding)),
str(round(energy_dict[period].get("cons", 0.0), rounding)),
# allocons
str(
round(
energy_dict[period]["cons"]
- energy_dict[period]["autocons"],
energy_dict[period].get("cons", 0.0)
- energy_dict[period].get("autocons", 0.0),
rounding,
)
),
# autocons
str(round(energy_dict[period]["autocons"], rounding)),
str(round(energy_dict[period].get("autocons", 0.0), rounding)),
]
)
)
sum_value["cons"] += round(energy_dict[period]["cons"], rounding)
sum_value["auto_cons"] += round(energy_dict[period]["autocons"], rounding)
sum_value["cons"] += round(energy_dict[period].get("cons", 0.0), rounding)
sum_value["auto_cons"] += round(
energy_dict[period].get("autocons", 0.0), rounding
)
sum_value["allo_cons"] += round(
energy_dict[period]["cons"] - energy_dict[period]["autocons"], rounding
energy_dict[period].get("cons", 0.0)
- energy_dict[period].get("autocons", 0.0),
rounding,
)
tot = ";".join(
[
"TOTAL",
str(round(sum_value.get("cons"), rounding)),
str(round(sum_value.get("allo_cons"), rounding)),
str(round(sum_value.get("auto_cons"), rounding)),
str(round(sum_value.get("cons", 0.0), rounding)),
str(round(sum_value.get("allo_cons", 0.0), rounding)),
str(round(sum_value.get("auto_cons", 0.0), rounding)),
]
)
data_file_lines.insert(0, tot)
......@@ -149,33 +153,35 @@ def make_prod_data(energy_dict):
# horodatage
period.strftime("%d/%m/%Y %H:%M"),
# production en kwh
str(round(energy_dict[period]["prod"], rounding)),
str(round(energy_dict[period].get("prod", 0.0), rounding)),
# surplus
str(round(energy_dict[period]["surplus"], rounding)),
str(round(energy_dict[period].get("surplus", 0.0), rounding)),
# autocons
str(
round(
energy_dict[period]["prod"]
- energy_dict[period]["surplus"],
energy_dict[period].get("prod", 0.0)
- energy_dict[period].get("surplus", 0.0),
rounding,
)
),
]
)
)
sum_value["prod"] += round(energy_dict[period]["prod"], rounding)
sum_value["surplus"] += round(energy_dict[period]["surplus"], rounding)
sum_value["prod"] += round(energy_dict[period].get("prod", 0.0), rounding)
sum_value["surplus"] += round(energy_dict[period].get("surplus", 0.0), rounding)
sum_value["auto_cons"] += round(
energy_dict[period]["prod"] - energy_dict[period]["surplus"], rounding
energy_dict[period].get("prod", 0.0)
- energy_dict[period].get("surplus", 0.0),
rounding,
)
tot = ";".join(
[
"TOTAL",
"",
str(round(sum_value.get("prod"), rounding)),
str(round(sum_value.get("surplus"), rounding)),
str(round(sum_value.get("auto_cons"), rounding)),
str(round(sum_value.get("prod", 0.0), rounding)),
str(round(sum_value.get("surplus", 0.0), rounding)),
str(round(sum_value.get("auto_cons", 0.0), rounding)),
]
)
data_file_lines.insert(0, tot)
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter