add EU oil bus already when adding land transport to be able to run the model without industry and avoid warning of missing bus. Add a check for scaling down total electricity demand to avoid warning of invalid value in double_scalar (#100)
This commit is contained in:
parent
e367f8ae11
commit
0e3d21f5a4
@ -1154,6 +1154,12 @@ def add_land_transport(network):
|
|||||||
|
|
||||||
if ice_share > 0:
|
if ice_share > 0:
|
||||||
|
|
||||||
|
if "EU oil" not in network.buses.index:
|
||||||
|
network.madd("Bus",
|
||||||
|
["EU oil"],
|
||||||
|
location="EU",
|
||||||
|
carrier="oil")
|
||||||
|
|
||||||
network.madd("Load",
|
network.madd("Load",
|
||||||
nodes,
|
nodes,
|
||||||
suffix=" land transport oil",
|
suffix=" land transport oil",
|
||||||
@ -1769,6 +1775,7 @@ def add_industry(network):
|
|||||||
#remove today's industrial electricity demand by scaling down total electricity demand
|
#remove today's industrial electricity demand by scaling down total electricity demand
|
||||||
for ct in n.buses.country.unique():
|
for ct in n.buses.country.unique():
|
||||||
loads = n.loads.index[(n.loads.index.str[:2] == ct) & (n.loads.carrier == "electricity")]
|
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()
|
factor = 1 - industrial_demand.loc[loads,"current electricity"].sum()/n.loads_t.p_set[loads].sum().sum()
|
||||||
n.loads_t.p_set[loads] *= factor
|
n.loads_t.p_set[loads] *= factor
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user