From 6b4705530d05d82ee605488c3b9a794522c19bb0 Mon Sep 17 00:00:00 2001 From: romainsacchi Date: Sat, 12 Oct 2024 15:45:23 +0000 Subject: [PATCH] Black reformating --- premise/validation.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/premise/validation.py b/premise/validation.py index 516784d1..0cce886f 100644 --- a/premise/validation.py +++ b/premise/validation.py @@ -1401,6 +1401,7 @@ def run_electricity_checks(self): self.check_efficiency() self.save_log() + class FuelsValidation(BaseDatasetValidator): def __init__(self, model, scenario, year, regions, database, iam_data): super().__init__(model, scenario, year, regions, database) @@ -1416,7 +1417,7 @@ def check_fuel_market_composition(self): "market for natural gas, high pressure", "market for hydrogen, gaseous", "market for kerosene", - "market for liquefied petroleum gas" + "market for liquefied petroleum gas", ] for ds in self.database: @@ -1429,10 +1430,14 @@ def check_fuel_market_composition(self): total = sum( [ - x["amount"] if x["unit"] == "cubic meter" else x["amount"] / 0.74 + ( + x["amount"] + if x["unit"] == "cubic meter" + else x["amount"] / 0.74 + ) for x in ds["exchanges"] if x["type"] == "technosphere" - and x["unit"] in ("kilogram", "cubic meter") + and x["unit"] in ("kilogram", "cubic meter") ] ) @@ -1441,7 +1446,8 @@ def check_fuel_market_composition(self): [ x["amount"] for x in ds["exchanges"] - if x["type"] == "technosphere" and x["unit"] in ("kilogram", "cubic meter") + if x["type"] == "technosphere" + and x["unit"] in ("kilogram", "cubic meter") ] ) if total < 0.99 or total > 1.1: @@ -1467,12 +1473,13 @@ def check_electrolysis_electricity_input(self): [ x["amount"] for x in ds["exchanges"] - if x["type"] == "technosphere" - and x["unit"] == "kilowatt hour" + if x["type"] == "technosphere" and x["unit"] == "kilowatt hour" ] ) if electricity < 40 or electricity > 60: - message = f"Electricity use for hydrogen production is {electricity}." + message = ( + f"Electricity use for hydrogen production is {electricity}." + ) self.log_issue( ds, "electricity use for hydrogen production",