From 1a7eb8aff6ab436dddefc7057de020e65297db97 Mon Sep 17 00:00:00 2001 From: romainsacchi Date: Fri, 10 May 2024 11:19:48 +0000 Subject: [PATCH] Black reformating --- premise/steel.py | 6 ++---- premise/validation.py | 9 +++++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/premise/steel.py b/premise/steel.py index c72e1c98..c029ab13 100644 --- a/premise/steel.py +++ b/premise/steel.py @@ -542,16 +542,14 @@ def adjust_process_efficiency(self, datasets): energy += sum( exc["amount"] * 26.4 for exc in ws.technosphere(dataset) - if "hard coal" in exc["name"] - and exc["unit"] == "kilogram" + if "hard coal" in exc["name"] and exc["unit"] == "kilogram" ) # add input of natural gas energy += sum( exc["amount"] * 36 for exc in ws.technosphere(dataset) - if "natural gas" in exc["name"] - and exc["unit"] == "cubic meter" + if "natural gas" in exc["name"] and exc["unit"] == "cubic meter" ) scaling_factor = max(9.0 / energy, scaling_factor) diff --git a/premise/validation.py b/premise/validation.py index f7580ac0..5b00766e 100644 --- a/premise/validation.py +++ b/premise/validation.py @@ -1186,7 +1186,8 @@ def check_electricity_mix(self): # check that the electricity mix in teh market datasets # corresponds to the IAM scenario projection vars = [ - x for x in self.iam_data.electricity_markets.coords["variables"].values + x + for x in self.iam_data.electricity_markets.coords["variables"].values if x.lower().startswith("hydro") ] @@ -1205,9 +1206,9 @@ def check_electricity_mix(self): dim="variables" ) else: - hydro_share = self.iam_data.electricity_markets.sel( - variables=vars - ).interp(year=self.year).sum(dim="variables") / self.iam_data.electricity_markets.sel( + hydro_share = self.iam_data.electricity_markets.sel(variables=vars).interp( + year=self.year + ).sum(dim="variables") / self.iam_data.electricity_markets.sel( variables=[ v for v in self.iam_data.electricity_markets.variables.values