@@ -152,11 +152,38 @@ def test_faiman_rad_ir():
152152
153153
154154def test_ross ():
155- result = temperature .ross (np .array ([1000. , 600. , 1000. ]),
156- np .array ([20. , 40. , 60. ]),
157- np .array ([40. , 100. , 20. ]))
158- expected = np .array ([45. , 100. , 60. ])
159- assert_allclose (expected , result )
155+ # single values
156+ result1 = temperature .ross (1000 ,30 ,noct = 50 )
157+ result2 = temperature .ross (1000 ,30 ,k = 0.0375 )
158+
159+ expected = 67.5
160+ assert_allclose (expected , result1 )
161+ assert_allclose (expected , result2 )
162+
163+ # pd.Series
164+ times = pd .date_range ('2025-07-30 14:00' , '2025-07-30 16:00' , freq = 'H' )
165+
166+ df = pd .DataFrame ({'t_air' : np .array ([20 ,30 ,40 ]),
167+ 'ghi' : np .array ([800 ,700 ,600 ])},
168+ index = times )
169+
170+ result1 = temperature .ross (df ['ghi' ],df ['t_air' ],noct = 50 )
171+ result2 = temperature .ross (df ['ghi' ],df ['t_air' ],k = 0.0375 )
172+
173+ expected = pd .Series ([50 ,56.25 ,62.5 ],index = times )
174+ assert_allclose (expected , result1 )
175+ assert_allclose (expected , result2 )
176+
177+ # np.array
178+ ghi_array = df ['ghi' ].values
179+ t_air_array = df ['t_air' ].values
180+
181+ result1 = temperature .ross (ghi_array , t_air_array , noct = 50 )
182+ result2 = temperature .ross (ghi_array , t_air_array , k = 0.0375 )
183+
184+ expected = expected .values
185+ assert_allclose (expected , result1 )
186+ assert_allclose (expected , result2 )
160187
161188
162189def test_faiman_series ():
0 commit comments