|
22 | 22 | investment_tax_credit_output_parameter, |
23 | 23 | lcoh_output_parameter, |
24 | 24 | lcoc_output_parameter, |
| 25 | + carbon_extracted_annually_output_parameter, |
25 | 26 | ) |
26 | 27 | from geophires_x.GeoPHIRESUtils import is_float, quantity, is_int |
27 | 28 | from geophires_x.Parameter import OutputParameter |
@@ -83,6 +84,7 @@ class SamEconomicsCalculations: |
83 | 84 | investment_tax_credit: OutputParameter = field(default_factory=investment_tax_credit_output_parameter) |
84 | 85 |
|
85 | 86 | capacity_payment_revenue_sources: list[CapacityPaymentRevenueSource] = field(default_factory=list) |
| 87 | + s_dac_carbon_extracted_annually: OutputParameter = field(default_factory=carbon_extracted_annually_output_parameter) |
86 | 88 |
|
87 | 89 | @property |
88 | 90 | def _pre_revenue_years_count(self) -> int: |
@@ -169,6 +171,8 @@ def _get_row(row_name__: str) -> list[Any]: |
169 | 171 |
|
170 | 172 | ret = self._insert_capacity_payment_line_items(ret) |
171 | 173 |
|
| 174 | + ret = self._insert_s_dac_line_items(ret) |
| 175 | + |
172 | 176 | ret = self._insert_calculated_levelized_metrics_line_items(ret) |
173 | 177 |
|
174 | 178 | if self._may_consume_grid_electricity: |
@@ -261,6 +265,70 @@ def _for_operational_years(_row: list[Any]) -> list[Any]: |
261 | 265 |
|
262 | 266 | return ret |
263 | 267 |
|
| 268 | + def _insert_s_dac_line_items(self, cf_ret: list[list[Any]]) -> list[list[Any]]: |
| 269 | + ret: list[list[Any]] = cf_ret.copy() |
| 270 | + |
| 271 | + def _get_row_index(row_name_: str) -> int: |
| 272 | + return [it[0] for it in ret].index(row_name_) |
| 273 | + |
| 274 | + def _insert_row_before(before_row_name: str, row_name: str, row_content: list[Any]) -> None: |
| 275 | + ret.insert( |
| 276 | + _get_row_index(before_row_name), |
| 277 | + [row_name, *row_content], |
| 278 | + ) |
| 279 | + |
| 280 | + def _insert_blank_line_before(before_row_name: str) -> None: |
| 281 | + _insert_row_before(before_row_name, '', ['' for _it in ret[_get_row_index(before_row_name)]][1:]) |
| 282 | + |
| 283 | + REVENUE_CATEGORY_ROW_NAME = 'REVENUE' |
| 284 | + ENERGY_CATEGORY_ROW_NAME = 'ENERGY' |
| 285 | + CAPACITY_PAYMENT_REVENUE_ROW_NAME = 'Capacity payment revenue ($)' |
| 286 | + |
| 287 | + _insert_blank_line_before(REVENUE_CATEGORY_ROW_NAME) |
| 288 | + # _insert_blank_line_before(CAPACITY_PAYMENT_REVENUE_ROW_NAME) |
| 289 | + |
| 290 | + def _for_operational_years(_row: list[Any]) -> list[Any]: |
| 291 | + return [*([''] * (self._pre_revenue_years_count - 1)), 0, *_row] |
| 292 | + |
| 293 | + _insert_row_before( |
| 294 | + REVENUE_CATEGORY_ROW_NAME, |
| 295 | + f'{self.s_dac_carbon_extracted_annually.Name} ({self.s_dac_carbon_extracted_annually.CurrentUnits})', |
| 296 | + _for_operational_years(self.s_dac_carbon_extracted_annually.value), |
| 297 | + ) |
| 298 | + _insert_blank_line_before(REVENUE_CATEGORY_ROW_NAME) |
| 299 | + |
| 300 | + # for i, capacity_payment_revenue_source in enumerate([None]): |
| 301 | + # if capacity_payment_revenue_source.amount_provided_label is not None: |
| 302 | + # |
| 303 | + # |
| 304 | + # revenue_row_name = f'{capacity_payment_revenue_source.name} revenue ($)' |
| 305 | + # _insert_row_before( |
| 306 | + # CAPACITY_PAYMENT_REVENUE_ROW_NAME, |
| 307 | + # revenue_row_name, |
| 308 | + # _for_operational_years(capacity_payment_revenue_source.revenue_usd), |
| 309 | + # ) |
| 310 | + # |
| 311 | + # if capacity_payment_revenue_source.price_label is not None: |
| 312 | + # _insert_row_before( |
| 313 | + # revenue_row_name, |
| 314 | + # capacity_payment_revenue_source.price_label.replace('USD', '$'), |
| 315 | + # capacity_payment_revenue_source.price, |
| 316 | + # ) |
| 317 | + # |
| 318 | + # if len(self.capacity_payment_revenue_sources) > 1 and i < len(self.capacity_payment_revenue_sources) - 1: |
| 319 | + # _insert_row_before( |
| 320 | + # CAPACITY_PAYMENT_REVENUE_ROW_NAME, |
| 321 | + # 'plus:', |
| 322 | + # ['' for _it in ret[_get_row_index(revenue_row_name)]][1:], |
| 323 | + # ) |
| 324 | + # |
| 325 | + # if len(self.capacity_payment_revenue_sources) > 0: |
| 326 | + # _insert_row_before( |
| 327 | + # CAPACITY_PAYMENT_REVENUE_ROW_NAME, 'equals:', ['' for _it in ret[_get_row_index(revenue_row_name)]][1:] |
| 328 | + # ) |
| 329 | + |
| 330 | + return ret |
| 331 | + |
264 | 332 | def _insert_calculated_levelized_metrics_line_items(self, cf_ret: list[list[Any]]) -> list[list[Any]]: |
265 | 333 | ret = cf_ret.copy() |
266 | 334 |
|
|
0 commit comments