File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 5
5
from pathlib import Path
6
6
from typing import Any
7
7
8
+ import numpy as np
9
+
8
10
from base_test_case import BaseTestCase
9
11
10
12
# ruff: noqa: I001 # Successful module initialization is dependent on this specific import order.
@@ -101,6 +103,24 @@ def _npv(r: GeophiresXResult) -> float:
101
103
for i in range (len (npvs ) - 1 ):
102
104
self .assertLess (npvs [i ], npvs [i + 1 ])
103
105
106
+ def test_electricity_generation_profile (self ):
107
+ r = self ._get_result ({})
108
+
109
+ cash_flow = r .result ['SAM CASH FLOW PROFILE' ]
110
+
111
+ def get_row (name : str ) -> list [float ]:
112
+ return EconomicsSamTestCase ._get_cash_flow_row (cash_flow , name )
113
+
114
+ geophires_avg_net_gen_GWh = r .result ['SURFACE EQUIPMENT SIMULATION RESULTS' ][
115
+ 'Average Annual Net Electricity Generation'
116
+ ]['value' ]
117
+ allowed_delta_percent = 15 # FIXME WIP investigate why this is so high
118
+ self .assertAlmostEqualWithinPercentage (
119
+ geophires_avg_net_gen_GWh ,
120
+ np .average (get_row ('Electricity to grid net (kWh)' )) * 1e-6 ,
121
+ allowed_delta_percent ,
122
+ )
123
+
104
124
def test_cash_flow (self ):
105
125
m : Model = EconomicsSamTestCase ._new_model (Path (self ._egs_test_file_path ()))
106
126
You can’t perform that action at this time.
0 commit comments