Skip to content

Commit

Permalink
Do not run _add_cost_defaults more than once
Browse files Browse the repository at this point in the history
  • Loading branch information
ppinchuk committed Oct 22, 2024
1 parent d1e482c commit e4cb954
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions reV/SAM/SAM.py
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,9 @@ def execute(self):

def _add_cost_defaults(sam_inputs):
"""Add default values for required cost outputs if they are missing. """
if sam_inputs.get("__already_added_cost_defaults"):
return

sam_inputs.setdefault("fixed_charge_rate", None)

reg_mult = sam_inputs.setdefault("capital_cost_multiplier", 1)
Expand All @@ -943,6 +946,8 @@ def _add_cost_defaults(sam_inputs):
else:
sam_inputs["capital_cost"] = None

sam_inputs["__already_added_cost_defaults"] = True


def _add_sys_capacity(sam_inputs):
"""Add system capacity SAM input if it is missing. """
Expand Down

0 comments on commit e4cb954

Please sign in to comment.