12
12
from pvlib import clearsky
13
13
from pvlib import solarposition
14
14
15
+ from . import requires_scipy
16
+
15
17
# setup times and location to be tested.
16
18
tus = Location (32.2 , - 111 , 'US/Arizona' , 700 )
17
19
times = pd .date_range (start = '2014-06-24' , end = '2014-06-25' , freq = '3h' )
20
22
ephem_data = solarposition .get_solarposition (times_localized , tus .latitude ,
21
23
tus .longitude )
22
24
23
-
25
+ @ requires_scipy
24
26
def test_ineichen_required ():
25
27
# the clearsky function should call lookup_linke_turbidity by default
26
- # will fail without scipy
27
28
expected = pd .DataFrame (np .array ([[0. ,0. ,0. ],
28
29
[0. ,0. ,0. ],
29
- [40.53660309 , 302.47614235 , 78.1470311 ],
30
- [98.88372629 , 865.98938602 , 699.93403875 ],
31
- [122.57870881 , 931.83716051 , 1038.62116584 ],
32
- [109.30270612 , 899.88002304 , 847.68806472 ],
33
- [64.25699595 , 629.91187925 , 254.53048144 ],
30
+ [51.0100314 , 259.73341927 , 82.76689082 ],
31
+ [104.99512329 , 832.22000002 , 682.43280974 ],
32
+ [121.97931179 , 901.31646645 , 1008.00975362 ],
33
+ [112.5726345 , 867.73434086 , 824.48415382 ],
34
+ [76.61228483 , 587.82419004 , 253.67624301 ],
34
35
[0. ,0. ,0. ],
35
36
[0. ,0. ,0. ]]),
36
37
columns = ['dhi' , 'dni' , 'ghi' ],
@@ -42,11 +43,11 @@ def test_ineichen_required():
42
43
def test_ineichen_supply_linke ():
43
44
expected = pd .DataFrame (np .array ([[0. ,0. ,0. ],
44
45
[0. ,0. ,0. ],
45
- [40.18673553 , 322.0649964 , 80.23287692 ],
46
- [95.14405816 ,876.49507151 ,703.48596755 ],
47
- [118.45873721 ,939.81653473 ,1042.34531752 ],
48
- [105.36671577 ,909.113377 ,851.3283881 ],
49
- [61.91607984 , 647.40869542 , 257.47471759 ],
46
+ [39.81862097 , 316.23284759 , 78.48350328 ],
47
+ [95.12705301 ,876.43232906 ,703.24156169 ],
48
+ [118.45796469 ,939.81499487 ,1042.33401282 ],
49
+ [105.35769022 ,909.0884868 ,851.19721202 ],
50
+ [61.83556162 , 646.45362207 , 256.55983299 ],
50
51
[0. ,0. ,0. ],
51
52
[0. ,0. ,0. ]]),
52
53
columns = ['dhi' , 'dni' , 'ghi' ],
@@ -66,11 +67,11 @@ def test_ineichen_solpos():
66
67
def test_ineichen_airmass ():
67
68
expected = pd .DataFrame (np .array ([[0. ,0. ,0. ],
68
69
[0. ,0. ,0. ],
69
- [41.70761136 , 293.72203458 , 78.22953786 ],
70
- [95.20590465 , 876.1650047 , 703.31872722 ],
71
- [118.46089555 , 939.8078753 , 1042.33896321 ],
72
- [105.39577655 , 908.97804342 , 851.24640259 ],
73
- [62.35382269 , 642.91022293 ,256.55363539 ],
70
+ [53.52826665 , 250.64463008 , 84.17386592 ],
71
+ [101.32775752 , 842.86030421 , 686.14824255 ],
72
+ [117.7568185 , 909.70199089 , 1012.03056908 ],
73
+ [108.61662929 , 877.27820363 , 828.35817853 ],
74
+ [75.15682967 , 601.03375193 ,256.19976209 ],
74
75
[0. ,0. ,0. ],
75
76
[0. ,0. ,0. ]]),
76
77
columns = ['dhi' , 'dni' , 'ghi' ],
0 commit comments