Skip to content

Commit

Permalink
parameter changed by decommission() depending on
Browse files Browse the repository at this point in the history
  • Loading branch information
SabineHaas committed Dec 12, 2024
1 parent 26c513e commit 61b20e6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions data_adapter_oemof/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,18 +354,20 @@ def default_post_mapping_calculations(self, mapped_defaults):
-------
"""
if len(self.structure["outputs"]) == 0:
change_parameter = "input_parameters"
if mapped_defaults["type"] == "mimo":
parameter_name = f"flow_share_max_{mapped_defaults['primary']}"
elif len(self.structure["outputs"]) == 0:
parameter_name = "input_parameters"
else:
change_parameter = "output_parameters"
parameter_name = "output_parameters"

# I:
if self.process_name[-1] == "0":
mapped_defaults = calculations.decommission(
process_name=self.process_name,
adapter_dict=mapped_defaults,
column="capacity",
input_output_parameters=change_parameter,
change_parameter=parameter_name,
)
elif self.process_name[-1] == "1" or self.process_name[-1] == "2":
mapped_defaults["expandable"] = True
Expand Down Expand Up @@ -393,7 +395,7 @@ def default_post_mapping_calculations(self, mapped_defaults):
process_name=self.process_name,
adapter_dict=mapped_defaults,
column="amount",
input_output_parameters=change_parameter,
change_parameter=parameter_name,
)

# III:
Expand Down
2 changes: 1 addition & 1 deletion data_adapter_oemof/calculations.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def get_capacity_cost(overnight_cost, fixed_cost, lifetime, wacc):


def decommission(
process_name, adapter_dict: dict, column: str = "capacity", max_column: str = "max", input_output_parameters: str = "output_parameters",
process_name, adapter_dict: dict, column: str = "capacity", max_column: str = "max", change_parameter: str = "output_parameters",
) -> dict:
"""
Expand Down

0 comments on commit 61b20e6

Please sign in to comment.