Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename Greece iso-code #1061

Merged
merged 2 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions scripts/build_energy_totals.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ def build_eurostat(input_eurostat, countries, nprocesses=1, disable_progressbar=
"Domestic navigation": "Domestic Navigation",
"International maritime bunkers": "Bunkers",
"UK": "GB",
"EL": "GR",
}
columns_rename = {"Total": "Total all products"}
df.rename(index=index_rename, columns=columns_rename, inplace=True)
Expand Down
49 changes: 29 additions & 20 deletions scripts/make_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,8 @@ def calculate_supply_energy(n, label, supply_energy):

def calculate_nodal_supply_energy(n, label, nodal_supply_energy):
"""
Calculate the total energy supply/consumption of each component at the buses
aggregated by carrier and node.
Calculate the total energy supply/consumption of each component at the
buses aggregated by carrier and node.
"""

bus_carriers = n.buses.carrier.unique()
Expand All @@ -432,22 +432,27 @@ def calculate_nodal_supply_energy(n, label, nodal_supply_energy):
continue

s = (
pd.concat([
(
c.pnl.p[items]
.multiply(n.snapshot_weightings.generators, axis=0)
.sum()
.multiply(c.df.loc[items, "sign"])
),
c.df.loc[items][["bus", "carrier"]]
], axis=1)
pd.concat(
[
(
c.pnl.p[items]
.multiply(n.snapshot_weightings.generators, axis=0)
.sum()
.multiply(c.df.loc[items, "sign"])
),
c.df.loc[items][["bus", "carrier"]],
],
axis=1,
)
.groupby(by=["bus", "carrier"])
.sum()[0]
)
s = pd.concat([s], keys=[c.list_name])
s = pd.concat([s], keys=[i])

nodal_supply_energy = nodal_supply_energy.reindex(s.index.union(nodal_supply_energy.index))
nodal_supply_energy = nodal_supply_energy.reindex(
s.index.union(nodal_supply_energy.index)
)
nodal_supply_energy.loc[s.index, label] = s

for c in n.iterate_components(n.branch_components):
Expand All @@ -458,14 +463,18 @@ def calculate_nodal_supply_energy(n, label, nodal_supply_energy):
continue

s = (
pd.concat([
(
(-1) * c.pnl["p" + end][items]
.multiply(n.snapshot_weightings.generators, axis=0)
.sum()
),
c.df.loc[items][["bus0", "carrier"]]
], axis=1)
pd.concat(
[
(
(-1)
* c.pnl["p" + end][items]
.multiply(n.snapshot_weightings.generators, axis=0)
.sum()
),
c.df.loc[items][["bus0", "carrier"]],
],
axis=1,
)
.groupby(by=["bus0", "carrier"])
.sum()[0]
)
Expand Down
Loading