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

add EU oil bus already when adding land transport to be able to run t… #100

Merged
merged 1 commit into from
May 25, 2021
Merged
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
7 changes: 7 additions & 0 deletions scripts/prepare_sector_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -1150,6 +1150,12 @@ def add_land_transport(network):

if ice_share > 0:

if "EU oil" not in network.buses.index:
network.madd("Bus",
["EU oil"],
location="EU",
carrier="oil")

network.madd("Load",
nodes,
suffix=" land transport oil",
Expand Down Expand Up @@ -1766,6 +1772,7 @@ def add_industry(network):
#remove today's industrial electricity demand by scaling down total electricity demand
for ct in n.buses.country.unique():
loads = n.loads.index[(n.loads.index.str[:2] == ct) & (n.loads.carrier == "electricity")]
if n.loads_t.p_set[loads].empty: continue
factor = 1 - industrial_demand.loc[loads,"current electricity"].sum()/n.loads_t.p_set[loads].sum().sum()
n.loads_t.p_set[loads] *= factor

Expand Down