1111from pvlib .location import Location
1212from pvlib import tracking
1313
14+ SINGLEAXIS_COL_ORDER = ['tracker_theta' , 'aoi' ,
15+ 'surface_azimuth' , 'surface_tilt' ]
1416
1517def test_solar_noon ():
1618 apparent_zenith = pd .Series ([10 ])
@@ -20,9 +22,10 @@ def test_solar_noon():
2022 max_angle = 90 , backtrack = True ,
2123 gcr = 2.0 / 7.0 )
2224
23- expect = pd .DataFrame ({'aoi ' : 10 , 'surface_azimuth ' : 90 ,
24- 'surface_tilt ' : 0 , 'tracker_theta ' : 0 },
25+ expect = pd .DataFrame ({'tracker_theta ' : 0 , 'aoi ' : 10 ,
26+ 'surface_azimuth ' : 90 , 'surface_tilt ' : 0 },
2527 index = [0 ], dtype = np .float64 )
28+ expect = expect [SINGLEAXIS_COL_ORDER ]
2629
2730 assert_frame_equal (expect , tracker_data )
2831
@@ -36,9 +39,10 @@ def test_azimuth_north_south():
3639 max_angle = 90 , backtrack = True ,
3740 gcr = 2.0 / 7.0 )
3841
39- expect = pd .DataFrame ({'aoi ' : 0 , 'surface_azimuth ' : 90 ,
40- 'surface_tilt ' : 60 , 'tracker_theta ' : - 60 },
42+ expect = pd .DataFrame ({'tracker_theta ' : - 60 , 'aoi ' : 0 ,
43+ 'surface_azimuth ' : 90 , 'surface_tilt ' : 60 },
4144 index = [0 ], dtype = np .float64 )
45+ expect = expect [SINGLEAXIS_COL_ORDER ]
4246
4347 assert_frame_equal (expect , tracker_data )
4448
@@ -63,6 +67,7 @@ def test_max_angle():
6367 expect = pd .DataFrame ({'aoi' : 15 , 'surface_azimuth' : 90 ,
6468 'surface_tilt' : 45 , 'tracker_theta' : 45 },
6569 index = [0 ], dtype = np .float64 )
70+ expect = expect [SINGLEAXIS_COL_ORDER ]
6671
6772 assert_frame_equal (expect , tracker_data )
6873
@@ -79,6 +84,7 @@ def test_backtrack():
7984 expect = pd .DataFrame ({'aoi' : 0 , 'surface_azimuth' : 90 ,
8085 'surface_tilt' : 80 , 'tracker_theta' : 80 },
8186 index = [0 ], dtype = np .float64 )
87+ expect = expect [SINGLEAXIS_COL_ORDER ]
8288
8389 assert_frame_equal (expect , tracker_data )
8490
@@ -90,6 +96,7 @@ def test_backtrack():
9096 expect = pd .DataFrame ({'aoi' : 52.5716 , 'surface_azimuth' : 90 ,
9197 'surface_tilt' : 27.42833 , 'tracker_theta' : 27.4283 },
9298 index = [0 ], dtype = np .float64 )
99+ expect = expect [SINGLEAXIS_COL_ORDER ]
93100
94101 assert_frame_equal (expect , tracker_data )
95102
@@ -104,8 +111,10 @@ def test_axis_tilt():
104111 gcr = 2.0 / 7.0 )
105112
106113 expect = pd .DataFrame ({'aoi' : 7.286245 , 'surface_azimuth' : 142.65730 ,
107- 'surface_tilt' : 35.98741 , 'tracker_theta' : - 20.88121 },
114+ 'surface_tilt' : 35.98741 ,
115+ 'tracker_theta' : - 20.88121 },
108116 index = [0 ], dtype = np .float64 )
117+ expect = expect [SINGLEAXIS_COL_ORDER ]
109118
110119 assert_frame_equal (expect , tracker_data )
111120
@@ -117,6 +126,7 @@ def test_axis_tilt():
117126 expect = pd .DataFrame ({'aoi' : 47.6632 , 'surface_azimuth' : 50.96969 ,
118127 'surface_tilt' : 42.5152 , 'tracker_theta' : 31.6655 },
119128 index = [0 ], dtype = np .float64 )
129+ expect = expect [SINGLEAXIS_COL_ORDER ]
120130
121131 assert_frame_equal (expect , tracker_data )
122132
@@ -133,6 +143,7 @@ def test_axis_azimuth():
133143 expect = pd .DataFrame ({'aoi' : 30 , 'surface_azimuth' : 180 ,
134144 'surface_tilt' : 0 , 'tracker_theta' : 0 },
135145 index = [0 ], dtype = np .float64 )
146+ expect = expect [SINGLEAXIS_COL_ORDER ]
136147
137148 assert_frame_equal (expect , tracker_data )
138149
@@ -147,6 +158,7 @@ def test_axis_azimuth():
147158 expect = pd .DataFrame ({'aoi' : 0 , 'surface_azimuth' : 180 ,
148159 'surface_tilt' : 30 , 'tracker_theta' : 30 },
149160 index = [0 ], dtype = np .float64 )
161+ expect = expect [SINGLEAXIS_COL_ORDER ]
150162
151163 assert_frame_equal (expect , tracker_data )
152164
@@ -184,8 +196,10 @@ def test_SingleAxisTracker_tracking():
184196 tracker_data = system .singleaxis (apparent_zenith , apparent_azimuth )
185197
186198 expect = pd .DataFrame ({'aoi' : 7.286245 , 'surface_azimuth' : 142.65730 ,
187- 'surface_tilt' : 35.98741 , 'tracker_theta' : - 20.88121 },
199+ 'surface_tilt' : 35.98741 ,
200+ 'tracker_theta' : - 20.88121 },
188201 index = [0 ], dtype = np .float64 )
202+ expect = expect [SINGLEAXIS_COL_ORDER ]
189203
190204 assert_frame_equal (expect , tracker_data )
191205
@@ -202,9 +216,11 @@ def test_SingleAxisTracker_tracking():
202216 apparent_azimuth = pd .Series ([180 + pvsyst_solar_azimuth ])
203217 apparent_zenith = pd .Series ([90 - pvsyst_solar_height ])
204218 tracker_data = pvsyst_system .singleaxis (apparent_zenith , apparent_azimuth )
205- expect = pd .DataFrame ({'aoi' : 41.07852 , 'surface_azimuth' : 180 - 18.432 ,
206- 'surface_tilt' : 24.92122 , 'tracker_theta' : - 15.18391 },
219+ expect = pd .DataFrame ({'aoi' : 41.07852 , 'surface_azimuth' : 180 - 18.432 ,
220+ 'surface_tilt' : 24.92122 ,
221+ 'tracker_theta' : - 15.18391 },
207222 index = [0 ], dtype = np .float64 )
223+ expect = expect [SINGLEAXIS_COL_ORDER ]
208224
209225 assert_frame_equal (expect , tracker_data )
210226
0 commit comments