Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 29, 2024
1 parent 763a0dc commit 5649a81
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 16 deletions.
6 changes: 3 additions & 3 deletions scripts/build_base_energy_totals.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ def calc_sector(sector):
)

elif sector == "road":
energy_totals_base.at[
country, "total road"
] = df_sector.Quantity_TWh.sum().round(4)
energy_totals_base.at[country, "total road"] = (
df_sector.Quantity_TWh.sum().round(4)
)

elif sector == "agriculture":
energy_totals_base.at[country, "agriculture electricity"] = (
Expand Down
12 changes: 6 additions & 6 deletions scripts/build_industrial_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,9 @@ def create_cement_db():
)
avg_c_cap = df_cement.groupby(df_cement.country)["capacity"].mean()
df_cement["capacity"] = df_cement.apply(
lambda x: avg_c_cap[x["country"]]
if math.isnan(x["capacity"])
else x["capacity"],
lambda x: (
avg_c_cap[x["country"]] if math.isnan(x["capacity"]) else x["capacity"]
),
axis=1,
)

Expand Down Expand Up @@ -454,9 +454,9 @@ def create_paper_df():
na_index

df_paper["capacity"] = df_paper.apply(
lambda x: avg_c_cap[x["country"]]
if math.isnan(x["capacity"])
else x["capacity"],
lambda x: (
avg_c_cap[x["country"]] if math.isnan(x["capacity"]) else x["capacity"]
),
axis=1,
)

Expand Down
2 changes: 1 addition & 1 deletion scripts/plot_network_eur.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ def plot_series(network, carrier="AC", name="test"):
"plot_network",
simpl="",
clusters=4,
planning_horizons=2030
planning_horizons=2030,
# lv=1.5,
# opts='',
# sector_opts='Co2L0-168H-T-H-B-I-solar+p3-dist1',
Expand Down
8 changes: 5 additions & 3 deletions scripts/plot_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,11 @@ def plot_balances():

# remove trailing link ports
df.index = [
i[:-1]
if ((i != "co2") and (i != "H2") and (i[-1:] in ["0", "1", "2", "3"]))
else i
(
i[:-1]
if ((i != "co2") and (i != "H2") and (i[-1:] in ["0", "1", "2", "3"]))
else i
)
for i in df.index
]

Expand Down
8 changes: 5 additions & 3 deletions scripts/prepare_sector_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -1277,9 +1277,11 @@ def add_industry(n, costs):
nodes,
suffix=" low-temperature heat for industry",
bus=[
node + " urban central heat"
if node + " urban central heat" in n.buses.index
else node + " services urban decentral heat"
(
node + " urban central heat"
if node + " urban central heat" in n.buses.index
else node + " services urban decentral heat"
)
for node in nodes
],
carrier="low-temperature heat for industry",
Expand Down

0 comments on commit 5649a81

Please sign in to comment.