2929
3030times = (pd .date_range ('2003-10-17 12:30:30' , periods = 1 , freq = 'D' )
3131 .tz_localize ('MST' ))
32- unixtimes = times .tz_convert ('UTC' ).astype (np .int64 )* 1.0 / 10 ** 9
32+ unixtimes = np .array (times .tz_convert ('UTC' ).astype (np .int64 )* 1.0 / 10 ** 9 )
33+
3334lat = 39.742476
3435lon = - 105.1786
3536elev = 1830.14
@@ -251,6 +252,9 @@ def test_transit_sunrise_sunset(self):
251252 sunset = pd .DatetimeIndex ([dt .datetime (1996 , 7 , 5 , 17 , 1 , 4 ),
252253 dt .datetime (2004 , 12 , 4 , 19 , 2 , 2 )]
253254 ).tz_localize ('UTC' ).astype (np .int64 )* 1.0 / 10 ** 9
255+ times = np .array (times )
256+ sunrise = np .array (sunrise )
257+ sunset = np .array (sunset )
254258 result = self .spa .transit_sunrise_sunset (times , - 35.0 , 0.0 , 64.0 , 1 )
255259 assert_almost_equal (sunrise / 1e3 , result [1 ]/ 1e3 , 3 )
256260 assert_almost_equal (sunset / 1e3 , result [2 ]/ 1e3 , 3 )
@@ -262,6 +266,9 @@ def test_transit_sunrise_sunset(self):
262266 ).tz_localize ('UTC' ).astype (np .int64 )* 1.0 / 10 ** 9
263267 sunrise = pd .DatetimeIndex ([dt .datetime (1994 , 1 , 2 , 7 , 8 , 12 ),]
264268 ).tz_localize ('UTC' ).astype (np .int64 )* 1.0 / 10 ** 9
269+ times = np .array (times )
270+ sunrise = np .array (sunrise )
271+ sunset = np .array (sunset )
265272 result = self .spa .transit_sunrise_sunset (times , 35.0 , 0.0 , 64.0 , 1 )
266273 assert_almost_equal (sunrise / 1e3 , result [1 ]/ 1e3 , 3 )
267274 assert_almost_equal (sunset / 1e3 , result [2 ]/ 1e3 , 3 )
@@ -283,6 +290,9 @@ def test_transit_sunrise_sunset(self):
283290 dt .datetime (2015 , 8 , 2 , 19 , 10 ),
284291 dt .datetime (2015 , 12 , 2 , 16 , 38 ),],
285292 ).tz_localize ('MST' ).astype (np .int64 )* 1.0 / 10 ** 9
293+ times = np .array (times )
294+ sunrise = np .array (sunrise )
295+ sunset = np .array (sunset )
286296 result = self .spa .transit_sunrise_sunset (times , 39.0 , - 105.0 , 64.0 , 1 )
287297 assert_almost_equal (sunrise / 1e3 , result [1 ]/ 1e3 , 1 )
288298 assert_almost_equal (sunset / 1e3 , result [2 ]/ 1e3 , 1 )
@@ -305,6 +315,9 @@ def test_transit_sunrise_sunset(self):
305315 dt .datetime (2015 , 12 , 2 , 16 , 50 ),],
306316 ).tz_localize ('Asia/Shanghai'
307317 ).astype (np .int64 )* 1.0 / 10 ** 9
318+ times = np .array (times )
319+ sunrise = np .array (sunrise )
320+ sunset = np .array (sunset )
308321 result = self .spa .transit_sunrise_sunset (times , 39.917 , 116.383 , 64.0 ,1 )
309322 assert_almost_equal (sunrise / 1e3 , result [1 ]/ 1e3 , 1 )
310323 assert_almost_equal (sunset / 1e3 , result [2 ]/ 1e3 , 1 )
@@ -313,6 +326,7 @@ def test_earthsun_distance(self):
313326 times = (pd .date_range ('2003-10-17 12:30:30' , periods = 1 , freq = 'D' )
314327 .tz_localize ('MST' ))
315328 unixtimes = times .tz_convert ('UTC' ).astype (np .int64 )* 1.0 / 10 ** 9
329+ unixtimes = np .array (unixtimes )
316330 result = self .spa .earthsun_distance (unixtimes , 64.0 , 1 )
317331 assert_almost_equal (R , result , 6 )
318332
0 commit comments