@@ -710,3 +710,38 @@ def test_single_time_step_per_year(self):
710
710
# )
711
711
#
712
712
# self.assertIsNotNone(result_1_1)
713
+
714
+ def test_multiple_construction_years (self ):
715
+ construction_years = 2
716
+ result = GeophiresXClient ().get_geophires_result (
717
+ GeophiresInputParameters (
718
+ from_file_path = self ._get_test_file_path ('geophires_x_tests/generic-egs-case.txt' ),
719
+ params = {'Construction Years' : construction_years },
720
+ )
721
+ )
722
+
723
+ total_capex = result .result ['CAPITAL COSTS (M$)' ]['Total capital costs' ]['value' ]
724
+
725
+ rcp = result .result ['REVENUE & CASHFLOW PROFILE' ]
726
+ project_lifetime = 25
727
+ self .assertEqual (project_lifetime + construction_years , len (rcp ) - 1 ) # Subtract 1 for headers
728
+ net_rev_idx = 14
729
+ net_cashflow_idx = 15
730
+
731
+ # Example expected output for first 2 years:
732
+ # [
733
+ # ...
734
+ # [0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -657.4, -657.4]
735
+ # [1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -657.4, -1314.79]
736
+ # ...
737
+ # ]
738
+
739
+ yearly_net_rev = - 1 * total_capex / construction_years
740
+ self .assertAlmostEqual (yearly_net_rev , rcp [1 ][net_rev_idx ], places = 1 )
741
+ self .assertAlmostEqual (yearly_net_rev , rcp [1 ][net_cashflow_idx ], places = 1 )
742
+ self .assertAlmostEqual (yearly_net_rev , rcp [2 ][net_rev_idx ], places = 1 )
743
+ self .assertEqual (- 1 * total_capex , rcp [2 ][net_cashflow_idx ])
744
+
745
+ pre_rev_idx = min (net_rev_idx , net_cashflow_idx )
746
+ self .assertListEqual ([0 ] * pre_rev_idx , rcp [1 ][:pre_rev_idx ])
747
+ self .assertListEqual ([1 ] + [0 ] * (pre_rev_idx - 1 ), rcp [2 ][:pre_rev_idx ])
0 commit comments