Skip to content

Commit

Permalink
Adapt to new structure
Browse files Browse the repository at this point in the history
  • Loading branch information
uvchik committed Feb 2, 2021
1 parent 9e61ead commit 64d44b8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/scenario_builder/config.py
Expand Up @@ -10,6 +10,7 @@
from reegis.config import get # noqa: F401
from reegis.config import get_dict # noqa: F401
from reegis.config import get_dict_list # noqa: F401
from reegis.config import get_list # noqa: F401
from reegis.config import init # noqa: F401

_loaded = False
Expand Down
12 changes: 6 additions & 6 deletions src/scenario_builder/powerplants.py
Expand Up @@ -227,7 +227,7 @@ def create_powerplants(
.loc["volatile_source"]
}

if cfg.get("basic", "group_transformer"):
if cfg.get("creator", "group_transformer"):
power_plants["transformer"] = (
pp.groupby(
["model_classes", region_column, "energy_source_level_2"]
Expand Down Expand Up @@ -266,8 +266,8 @@ def create_powerplants(
pp_class["capacity"] / pp_class["capacity_in"] * 100
)
del pp_class["capacity_in"]
if cfg.get("basic", "round") is not None:
pp_class = pp_class.round(cfg.get("basic", "round"))
if cfg.get("creator", "round") is not None:
pp_class = pp_class.round(cfg.get("creator", "round"))
if "efficiency" in pp_class:
pp_class["efficiency"] = pp_class["efficiency"].div(100)
pp_class = pp_class.transpose()
Expand All @@ -291,7 +291,7 @@ def add_additional_values(table_collection):
"""
transf = table_collection["transformer"]
for values in ["variable_costs", "downtime_factor"]:
if cfg.get("basic", "use_{0}".format(values)) is True:
if cfg.get("creator", "use_{0}".format(values)) is True:
add_values = getattr(data.get_ewi_data(), values)
transf = transf.merge(
add_values, right_index=True, how="left", left_on="fuel",
Expand All @@ -316,11 +316,11 @@ def add_pp_limit(table_collection, year):
-------
"""
if len(cfg.get_dict("limited_transformer").keys()) > 0:
if len(cfg.get_list("creator", "limited_transformer")) > 0:
# Multiply with 1000 to get MWh (bmwi: GWh)
repp = bmwi.bmwi_re_energy_capacity() * 1000
trsf = table_collection["transformer"]
for limit_trsf in cfg.get_dict("limited_transformer").keys():
for limit_trsf in cfg.get_list("creator", "limited_transformer"):
trsf = table_collection["transformer"]
try:
limit = repp.loc[year, (limit_trsf, "energy")]
Expand Down

0 comments on commit 64d44b8

Please sign in to comment.