Skip to content

Commit fdddcd9

Browse files
test_royalty_rate_schedule
1 parent 71116b4 commit fdddcd9

File tree

2 files changed

+45
-2
lines changed

2 files changed

+45
-2
lines changed

src/geophires_x/Economics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@ def __init__(self, model: Model):
981981
)
982982

983983
self.royalty_escalation_rate = self.ParameterDict[self.royalty_escalation_rate.Name] = floatParameter(
984-
'Royalty Escalation Rate',
984+
'Royalty Rate Escalation',
985985
DefaultValue=0.,
986986
Min=0.0,
987987
Max=1.0,
@@ -993,7 +993,7 @@ def __init__(self, model: Model):
993993
)
994994

995995
self.maximum_royalty_rate = self.ParameterDict[self.maximum_royalty_rate.Name] = floatParameter(
996-
'Maximum Royalty Rate',
996+
'Royalty Rate Maximum',
997997
DefaultValue=1.0, # Default to 100% (no effective cap)
998998
Min=0.0,
999999
Max=1.0,

tests/geophires_x_tests/test_economics_sam.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
_ppa_pricing_model,
2222
_get_fed_and_state_tax_rates,
2323
SamEconomicsCalculations,
24+
_get_royalty_rate_schedule,
2425
)
2526
from geophires_x.GeoPHIRESUtils import sig_figs, quantity
2627

@@ -662,6 +663,48 @@ def get_row(name: str):
662663
# Note the above assertion assumes royalties are the only production-based O&M expenses. If this changes,
663664
# the assertion will need to be updated.
664665

666+
def test_royalty_rate_schedule(self):
667+
royalty_rate = 0.1
668+
escalation_rate = 0.01
669+
max_rate = royalty_rate + 5 * escalation_rate
670+
m: Model = EconomicsSamTestCase._new_model(
671+
self._egs_test_file_path(),
672+
additional_params={
673+
'Royalty Rate': royalty_rate,
674+
'Royalty Rate Escalation': escalation_rate,
675+
'Royalty Rate Maximum': max_rate,
676+
},
677+
)
678+
679+
schedule: list[float] = _get_royalty_rate_schedule(m)
680+
681+
self.assertListAlmostEqual(
682+
[
683+
0.1,
684+
0.11,
685+
0.12,
686+
0.13,
687+
0.14,
688+
0.15,
689+
0.15,
690+
0.15,
691+
0.15,
692+
0.15,
693+
0.15,
694+
0.15,
695+
0.15,
696+
0.15,
697+
0.15,
698+
0.15,
699+
0.15,
700+
0.15,
701+
0.15,
702+
0.15,
703+
],
704+
schedule,
705+
places=3,
706+
)
707+
665708
@staticmethod
666709
def _new_model(input_file: Path, additional_params: dict[str, Any] | None = None, read_and_calculate=True) -> Model:
667710
if additional_params is not None:

0 commit comments

Comments
 (0)