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

Features/#353 pypsa eur results in 3h resolution #357

Merged
15 changes: 5 additions & 10 deletions src/egon/data/datasets/chp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
scale_prox2now,
)

from egon.data.datasets.pypsaeur import read_network

Base = declarative_base()


Expand Down Expand Up @@ -588,17 +590,10 @@ def insert_chp_egon100re():

if config.settings()["egon-data"]["--dataset-boundary"] != "Everything":
additional_capacity /= 16
target_file = (
Path(".")
/ "data_bundle_egon_data"
/ "pypsa_eur_sec"
/ "2022-07-26-egondata-integration"
/ "postnetworks"
/ "elec_s_37_lv2.0__Co2L0-1H-T-H-B-I-dist1_2050.nc"
)

network = pypsa.Network(str(target_file))
chp_index = "DE0 0 urban central gas CHP"
network = read_network()

chp_index = "DE0 0 urban central gas CHP-2045"

standard_chp_th = 10
standard_chp_el = (
Expand Down
13 changes: 2 additions & 11 deletions src/egon/data/datasets/gas_neighbours/eGon2035.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from egon.data.datasets.gas_neighbours.gas_abroad import (
insert_gas_grid_capacities,
)
from egon.data.datasets.pypsaeur import prepared_network
from egon.data.datasets.scenario_parameters import get_sector_parameters

countries = [
Expand Down Expand Up @@ -638,17 +639,7 @@ def import_ch4_demandTS():

"""

cwd = Path(".")
target_file = (
cwd
/ "data_bundle_egon_data"
/ "pypsa_eur_sec"
/ "2022-07-26-egondata-integration"
/ "postnetworks"
/ "elec_s_37_lv2.0__Co2L0-1H-T-H-B-I-dist1_2050.nc"
)

network = pypsa.Network(str(target_file))
network = prepared_network()

# Set country tag for all buses
network.buses.country = network.buses.index.str[:2]
Expand Down
14 changes: 11 additions & 3 deletions src/egon/data/datasets/industrial_gas_demand.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
initialise_bus_insertion,
)
from egon.data.datasets.etrago_setup import link_geom_from_buses
from egon.data.datasets.pypsaeur import read_network
from egon.data.datasets.pypsaeur import (read_network, prepared_network)
from egon.data.datasets.scenario_parameters import get_sector_parameters

logger = logging.getLogger(__name__)
Expand All @@ -48,7 +48,7 @@ class IndustrialGasDemand(Dataset):
#:
name: str = "IndustrialGasDemand"
#:
version: str = "0.0.5"
version: str = "0.0.6"

def __init__(self, dependencies):
super().__init__(
Expand Down Expand Up @@ -487,14 +487,22 @@ def insert_industrial_gas_demand_egon100RE():
# adjust H2 and CH4 total demands (values from PES)
# CH4 demand = 0 in 100RE, therefore scale H2 ts
# fallback values see https://github.com/openego/eGon-data/issues/626
n = read_network()
n = prepared_network()
solved_network = read_network()

try:
H2_total_PES = (
n.loads[n.loads["carrier"] == "H2 for industry"].loc[
"DE0 0 H2 for industry", "p_set"
]
* 8760
# Add h2 demand of Fischer-Tropsch process from pypsa-eur
+ solved_network.links_t.p0[
solved_network.links.loc[
solved_network.links.index.str.contains(
"DE0 0 Fischer-Tropsch")].index].mul(
solved_network.snapshot_weightings.generators,
axis= 0).sum().sum()
)
except KeyError:
H2_total_PES = 42090000
Expand Down
Loading
Loading