Skip to content

Commit

Permalink
Black reformating
Browse files Browse the repository at this point in the history
  • Loading branch information
romainsacchi committed Jun 6, 2024
1 parent d1f671f commit e5c1381
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions premise/electricity.py
Original file line number Diff line number Diff line change
Expand Up @@ -1447,15 +1447,11 @@ def update_efficiency_of_solar_pv(self) -> None:
current_eff = power / max_power

if self.year in module_eff.coords["year"].values:
new_eff = module_eff.sel(
technology=pv_tech, year=self.year
).values
new_eff = module_eff.sel(technology=pv_tech, year=self.year).values
else:
new_eff = (
module_eff.sel(technology=pv_tech)
.interp(
year=self.year, kwargs={"fill_value": "extrapolate"}
)
.interp(year=self.year, kwargs={"fill_value": "extrapolate"})
.values
)

Expand All @@ -1475,9 +1471,7 @@ def update_efficiency_of_solar_pv(self) -> None:
if "log parameters" not in dataset:
dataset["log parameters"] = {}

dataset["log parameters"].update(
{"old efficiency": current_eff}
)
dataset["log parameters"].update({"old efficiency": current_eff})
dataset["log parameters"].update({"new efficiency": new_eff})

# add to log
Expand Down Expand Up @@ -2009,7 +2003,9 @@ def adjust_aluminium_electricity_markets(self) -> None:
for dataset in ws.get_many(
self.database,
*[
ws.contains("name", "market for electricity, high voltage, aluminium industry"),
ws.contains(
"name", "market for electricity, high voltage, aluminium industry"
),
ws.equals("unit", "kilowatt hour"),
],
):
Expand All @@ -2027,7 +2023,9 @@ def adjust_aluminium_electricity_markets(self) -> None:
"product": f"electricity, high voltage",
"amount": 1,
"uncertainty type": 0,
"location": self.geo.ecoinvent_to_iam_location(dataset["location"]),
"location": self.geo.ecoinvent_to_iam_location(
dataset["location"]
),
"type": "technosphere",
"unit": "kilowatt hour",
}
Expand Down

0 comments on commit e5c1381

Please sign in to comment.