14
14
from pvlib .location import Location
15
15
from pvlib import solarposition
16
16
17
+ from . import requires_ephem
17
18
18
19
# setup times and locations to be tested.
19
20
times = pd .date_range (start = datetime .datetime (2014 ,6 ,24 ),
@@ -176,7 +177,7 @@ def test_get_sun_rise_set_transit():
176
177
del result ['transit' ]
177
178
assert_frame_equal (frame , result )
178
179
179
-
180
+ @ requires_ephem
180
181
def test_pyephem_physical ():
181
182
times = pd .date_range (datetime .datetime (2003 ,10 ,17 ,12 ,30 ,30 ),
182
183
periods = 1 , freq = 'D' , tz = golden_mst .tz )
@@ -188,7 +189,7 @@ def test_pyephem_physical():
188
189
assert_frame_equal (this_expected .round (2 ),
189
190
ephem_data [this_expected .columns ].round (2 ))
190
191
191
-
192
+ @ requires_ephem
192
193
def test_pyephem_physical_dst ():
193
194
times = pd .date_range (datetime .datetime (2003 ,10 ,17 ,13 ,30 ,30 ), periods = 1 ,
194
195
freq = 'D' , tz = golden .tz )
@@ -200,7 +201,7 @@ def test_pyephem_physical_dst():
200
201
assert_frame_equal (this_expected .round (2 ),
201
202
ephem_data [this_expected .columns ].round (2 ))
202
203
203
-
204
+ @ requires_ephem
204
205
def test_calc_time ():
205
206
import pytz
206
207
import math
@@ -225,7 +226,7 @@ def test_calc_time():
225
226
assert_almost_equals ((az .replace (second = 0 , microsecond = 0 ) -
226
227
epoch_dt ).total_seconds (), actual_timestamp )
227
228
228
-
229
+ @ requires_ephem
229
230
def test_earthsun_distance ():
230
231
times = pd .date_range (datetime .datetime (2003 ,10 ,17 ,13 ,30 ,30 ),
231
232
periods = 1 , freq = 'D' )
@@ -242,8 +243,9 @@ def test_ephemeris_physical():
242
243
temperature = 11 )
243
244
this_expected = expected .copy ()
244
245
this_expected .index = times
245
- assert_frame_equal (this_expected .round (2 ),
246
- ephem_data [this_expected .columns ].round (2 ))
246
+ this_expected = np .round (this_expected , 2 )
247
+ ephem_data = np .round (ephem_data , 2 )
248
+ assert_frame_equal (this_expected , ephem_data [this_expected .columns ])
247
249
248
250
249
251
def test_ephemeris_physical_dst ():
@@ -254,5 +256,6 @@ def test_ephemeris_physical_dst():
254
256
temperature = 11 )
255
257
this_expected = expected .copy ()
256
258
this_expected .index = times
257
- assert_frame_equal (this_expected .round (2 ),
258
- ephem_data [this_expected .columns ].round (2 ))
259
+ this_expected = np .round (this_expected , 2 )
260
+ ephem_data = np .round (ephem_data , 2 )
261
+ assert_frame_equal (this_expected , ephem_data [this_expected .columns ])
0 commit comments