Skip to content

Commit

Permalink
Black reformating
Browse files Browse the repository at this point in the history
  • Loading branch information
romainsacchi committed May 10, 2024
1 parent 1d0cc46 commit 1a7eb8a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
6 changes: 2 additions & 4 deletions premise/steel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 5 additions & 4 deletions premise/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
]

Expand All @@ -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
Expand Down

0 comments on commit 1a7eb8a

Please sign in to comment.