Skip to content

Commit

Permalink
removed difference in setting om related costs for battery so battery…
Browse files Browse the repository at this point in the history
… cost is calculated correctly
  • Loading branch information
elenya-grant authored and bayc committed Sep 3, 2024
1 parent 94282b8 commit fdbabe9
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions hopp/simulation/technologies/power_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,18 +449,18 @@ def total_installed_cost(self, total_installed_cost_dollars: float):
@property
def om_capacity(self):
"""Capacity-based O&M amount [$/kWcap]"""
if self.name != "Battery":
return self._financial_model.value("om_capacity")
return self._financial_model.value("om_batt_capacity_cost")
# if self.name != "Battery":
return self._financial_model.value("om_capacity")
# return self._financial_model.value("om_batt_capacity_cost")

@om_capacity.setter
def om_capacity(self, om_capacity_per_kw: Sequence):
if not array_not_scalar(om_capacity_per_kw):
om_capacity_per_kw = (om_capacity_per_kw,)
if self.name != "Battery":
self._financial_model.value("om_capacity", om_capacity_per_kw)
else:
self._financial_model.value("om_batt_capacity_cost", om_capacity_per_kw)
# if self.name != "Battery":
self._financial_model.value("om_capacity", om_capacity_per_kw)
# else:
# self._financial_model.value("om_batt_capacity_cost", om_capacity_per_kw)

@property
def om_production(self):
Expand All @@ -476,38 +476,38 @@ def om_production(self, om_production_per_mwh: Sequence):
@property
def om_fixed(self):
"""Fixed O&M annual amount [$/year]"""
if self.name != "Battery":
return self._financial_model.value("om_fixed")
return self._financial_model.value("om_batt_fixed_cost")
# if self.name != "Battery":
return self._financial_model.value("om_fixed")
# return self._financial_model.value("om_batt_fixed_cost")

@om_fixed.setter
def om_fixed(self, om_fixed_per_year: Sequence):
if not array_not_scalar(om_fixed_per_year):
om_fixed_per_year = (om_fixed_per_year,)
if self.name != "Battery":
self._financial_model.value("om_fixed", om_fixed_per_year)
else:
self._financial_model.value("om_batt_fixed_cost", om_fixed_per_year)
# if self.name != "Battery":
self._financial_model.value("om_fixed", om_fixed_per_year)
# else:
# self._financial_model.value("om_batt_fixed_cost", om_fixed_per_year)

@property
def om_variable(self):
"""
For non-battery technologies: Production-based O&M amount [$/kWh]
For battery: production-based System Costs amount [$/kWh-discharged]
"""
if self.name != "Battery":
return [i * 1e3 for i in self._financial_model.value("om_production")]
else:
return [i * 1e3 for i in self._financial_model.value("om_batt_variable_cost")]
# if self.name != "Battery":
return [i * 1e3 for i in self._financial_model.value("om_production")]
# else:
# return [i * 1e3 for i in self._financial_model.value("om_batt_variable_cost")]

@om_variable.setter
def om_variable(self, om_variable_per_kwh: Sequence):
if not array_not_scalar(om_variable_per_kwh):
om_variable_per_kwh = (om_variable_per_kwh,)
if self.name != "Battery":
self._financial_model.value("om_production", [i * 1e-3 for i in om_variable_per_kwh])
else:
self._financial_model.value("om_batt_variable_cost", [i * 1e-3 for i in om_variable_per_kwh])
# if self.name != "Battery":
self._financial_model.value("om_production", [i * 1e-3 for i in om_variable_per_kwh])
# else:
# self._financial_model.value("om_batt_variable_cost", [i * 1e-3 for i in om_variable_per_kwh])

@property
def construction_financing_cost(self) -> float:
Expand Down

0 comments on commit fdbabe9

Please sign in to comment.