Skip to content

Commit ef7ac09

Browse files
Fix incorrect method of setting royalties output param value
1 parent 274ca28 commit ef7ac09

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/geophires_x/Economics.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2507,7 +2507,9 @@ def Calculate(self, model: Model) -> None:
25072507
self.CCap.value = (self.sam_economics_calculations.capex.quantity()
25082508
.to(self.CCap.CurrentUnits.value).magnitude)
25092509

2510-
average_annual_royalties = np.average(self.sam_economics_calculations.royalties_opex[1:]) # ignore Year 0
2510+
average_annual_royalties = np.average(
2511+
self.sam_economics_calculations.royalties_opex.value[1:] # ignore pre-revenue year(s) (Year 0)
2512+
)
25112513
if average_annual_royalties > 0:
25122514
self.royalties_opex.value = average_annual_royalties
25132515
self.Coam.value += self.royalties_opex.quantity().to(self.Coam.CurrentUnits.value).magnitude

src/geophires_x/EconomicsSam.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def sf(_v: float, num_sig_figs: int = 5) -> float:
176176
royalty_rate = model.economics.royalty_rate.quantity().to('dimensionless').magnitude
177177
ppa_revenue_row = _cash_flow_profile_row(cash_flow, 'PPA revenue ($)')
178178
royalties_unit = sam_economics.royalties_opex.CurrentUnits.value.replace('/yr', '')
179-
sam_economics.royalties_opex = [
179+
sam_economics.royalties_opex.value = [
180180
quantity(x * royalty_rate, 'USD').to(royalties_unit).magnitude for x in ppa_revenue_row
181181
]
182182

tests/geophires_x_tests/test_economics_sam.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ def get_row(name: str):
655655
expected_royalties_USD = [x * royalty_rate for x in ppa_revenue_row_USD]
656656
expected_royalties_MUSD = [x * 1e-6 for x in expected_royalties_USD]
657657

658-
self.assertListEqual(expected_royalties_MUSD, sam_econ.royalties_opex)
658+
self.assertListEqual(expected_royalties_MUSD, sam_econ.royalties_opex.value)
659659

660660
om_prod_based_expense_row = get_row('O&M production-based expense ($)')
661661
self.assertListAlmostEqual(expected_royalties_USD, om_prod_based_expense_row, places=0)

0 commit comments

Comments
 (0)