7
7
import pandas as pd
8
8
9
9
from nose .tools import raises , assert_almost_equals
10
+ from nose .plugins .skip import SkipTest
10
11
from pandas .util .testing import assert_frame_equal
11
12
12
13
from pvlib .location import Location
30
31
31
32
def test_spa_physical ():
32
33
times = pd .date_range (datetime .datetime (2003 ,10 ,17 ,12 ,30 ,30 ), periods = 1 , freq = 'D' )
33
- ephem_data = solarposition .spa (times , golden_mst ).ix [0 ]
34
-
34
+ try :
35
+ ephem_data = solarposition .spa (times , golden_mst ).ix [0 ]
36
+ except ImportError :
37
+ raise SkipTest
35
38
assert_almost_equals (50.111622 , ephem_data ['zenith' ], 6 )
36
39
assert_almost_equals (194.340241 , ephem_data ['azimuth' ], 6 )
37
40
assert_almost_equals (39.888378 , ephem_data ['elevation' ], 6 )
@@ -40,17 +43,21 @@ def test_spa_physical():
40
43
41
44
def test_spa_physical_dst ():
42
45
times = pd .date_range (datetime .datetime (2003 ,10 ,17 ,13 ,30 ,30 ), periods = 1 , freq = 'D' )
43
- ephem_data = solarposition .spa (times , golden ).ix [0 ]
44
-
46
+ try :
47
+ ephem_data = solarposition .spa (times , golden ).ix [0 ]
48
+ except ImportError :
49
+ raise SkipTest
45
50
assert_almost_equals (50.111622 , ephem_data ['zenith' ], 6 )
46
51
assert_almost_equals (194.340241 , ephem_data ['azimuth' ], 6 )
47
52
assert_almost_equals (39.888378 , ephem_data ['elevation' ], 6 )
48
53
49
54
50
55
51
56
def test_spa_localization ():
52
- assert_frame_equal (solarposition .spa (times , tus ), solarposition .spa (times_localized , tus ))
53
-
57
+ try :
58
+ assert_frame_equal (solarposition .spa (times , tus ), solarposition .spa (times_localized , tus ))
59
+ except ImportError :
60
+ raise SkipTest
54
61
55
62
56
63
def test_pyephem_physical ():
0 commit comments