20
20
from pvlib .tools import _build_kwargs
21
21
from pvlib .location import Location
22
22
from pvlib import irradiance , atmosphere
23
- from pvlib import singlediode_methods
23
+ import pvlib # FIXME: import singlediode module from pvlib
24
24
25
25
26
26
# not sure if this belongs in the pvsystem module.
@@ -1963,7 +1963,7 @@ def singlediode(photocurrent, saturation_current, resistance_series,
1963
1963
open-circuit.
1964
1964
1965
1965
If the method is either ``'newton'`` or ``'brentq'`` and ``ivcurve_pnts``
1966
- are indicated, then :func:`pvlib.singlediode_methods .bishop88` is used to
1966
+ are indicated, then :func:`pvlib.singlediode .bishop88` is used to
1967
1967
calculate the points on the IV curve points at diode voltages from zero to
1968
1968
open-circuit voltage with a log spacing that gets closer as voltage
1969
1969
increases. If the method is ``'lambertw'`` then the calculated points on
@@ -2029,12 +2029,12 @@ def singlediode(photocurrent, saturation_current, resistance_series,
2029
2029
--------
2030
2030
sapm
2031
2031
calcparams_desoto
2032
- pvlib.singlediode_methods .bishop88
2032
+ pvlib.singlediode .bishop88
2033
2033
"""
2034
2034
# Calculate points on the IV curve using the LambertW solution to the
2035
2035
# single diode equation
2036
2036
if method .lower () == 'lambertw' :
2037
- out = singlediode_methods ._lambertw (
2037
+ out = pvlib . singlediode ._lambertw (
2038
2038
photocurrent , saturation_current , resistance_series ,
2039
2039
resistance_shunt , nNsVth , ivcurve_pnts
2040
2040
)
@@ -2047,19 +2047,19 @@ def singlediode(photocurrent, saturation_current, resistance_series,
2047
2047
# equation for the diode voltage V_d then backing out voltage
2048
2048
args = (photocurrent , saturation_current , resistance_series ,
2049
2049
resistance_shunt , nNsVth ) # collect args
2050
- v_oc = singlediode_methods .bishop88_v_from_i (
2050
+ v_oc = pvlib . singlediode .bishop88_v_from_i (
2051
2051
0.0 , * args , method = method .lower ()
2052
2052
)
2053
- i_mp , v_mp , p_mp = singlediode_methods .bishop88_mpp (
2053
+ i_mp , v_mp , p_mp = pvlib . singlediode .bishop88_mpp (
2054
2054
* args , method = method .lower ()
2055
2055
)
2056
- i_sc = singlediode_methods .bishop88_i_from_v (
2056
+ i_sc = pvlib . singlediode .bishop88_i_from_v (
2057
2057
0.0 , * args , method = method .lower ()
2058
2058
)
2059
- i_x = singlediode_methods .bishop88_i_from_v (
2059
+ i_x = pvlib . singlediode .bishop88_i_from_v (
2060
2060
v_oc / 2.0 , * args , method = method .lower ()
2061
2061
)
2062
- i_xx = singlediode_methods .bishop88_i_from_v (
2062
+ i_xx = pvlib . singlediode .bishop88_i_from_v (
2063
2063
(v_oc + v_mp ) / 2.0 , * args , method = method .lower ()
2064
2064
)
2065
2065
@@ -2069,7 +2069,7 @@ def singlediode(photocurrent, saturation_current, resistance_series,
2069
2069
(11.0 - np .logspace (np .log10 (11.0 ), 0.0 ,
2070
2070
ivcurve_pnts )) / 10.0
2071
2071
)
2072
- ivcurve_i , ivcurve_v , _ = singlediode_methods .bishop88 (vd , * args )
2072
+ ivcurve_i , ivcurve_v , _ = pvlib . singlediode .bishop88 (vd , * args )
2073
2073
2074
2074
out = OrderedDict ()
2075
2075
out ['i_sc' ] = i_sc
@@ -2125,7 +2125,7 @@ def max_power_point(photocurrent, saturation_current, resistance_series,
2125
2125
curve. This function uses Brent's method by default because it is
2126
2126
guaranteed to converge.
2127
2127
"""
2128
- i_mp , v_mp , p_mp = singlediode_methods .bishop88_mpp (
2128
+ i_mp , v_mp , p_mp = pvlib . singlediode .bishop88_mpp (
2129
2129
photocurrent , saturation_current , resistance_series ,
2130
2130
resistance_shunt , nNsVth , method = method .lower ()
2131
2131
)
@@ -2205,7 +2205,7 @@ def v_from_i(resistance_shunt, resistance_series, nNsVth, current,
2205
2205
Energy Materials and Solar Cells, 81 (2004) 269-277.
2206
2206
'''
2207
2207
if method .lower () == 'lambertw' :
2208
- return singlediode_methods ._lambertw_v_from_i (
2208
+ return pvlib . singlediode ._lambertw_v_from_i (
2209
2209
resistance_shunt , resistance_series , nNsVth , current ,
2210
2210
saturation_current , photocurrent
2211
2211
)
@@ -2215,9 +2215,9 @@ def v_from_i(resistance_shunt, resistance_series, nNsVth, current,
2215
2215
# equation for the diode voltage V_d then backing out voltage
2216
2216
args = (current , photocurrent , saturation_current ,
2217
2217
resistance_series , resistance_shunt , nNsVth )
2218
- V = singlediode_methods .bishop88_v_from_i (* args , method = method .lower ())
2218
+ V = pvlib . singlediode .bishop88_v_from_i (* args , method = method .lower ())
2219
2219
# find the right size and shape for returns
2220
- size , shape = singlediode_methods ._get_size_and_shape (args )
2220
+ size , shape = pvlib . singlediode ._get_size_and_shape (args )
2221
2221
if size <= 1 :
2222
2222
if shape is not None :
2223
2223
V = np .tile (V , shape )
@@ -2293,7 +2293,7 @@ def i_from_v(resistance_shunt, resistance_series, nNsVth, voltage,
2293
2293
Energy Materials and Solar Cells, 81 (2004) 269-277.
2294
2294
'''
2295
2295
if method .lower () == 'lambertw' :
2296
- return singlediode_methods ._lambertw_i_from_v (
2296
+ return pvlib . singlediode ._lambertw_i_from_v (
2297
2297
resistance_shunt , resistance_series , nNsVth , voltage ,
2298
2298
saturation_current , photocurrent
2299
2299
)
@@ -2303,9 +2303,9 @@ def i_from_v(resistance_shunt, resistance_series, nNsVth, voltage,
2303
2303
# equation for the diode voltage V_d then backing out voltage
2304
2304
args = (voltage , photocurrent , saturation_current , resistance_series ,
2305
2305
resistance_shunt , nNsVth )
2306
- I = singlediode_methods .bishop88_i_from_v (* args , method = method .lower ())
2306
+ I = pvlib . singlediode .bishop88_i_from_v (* args , method = method .lower ())
2307
2307
# find the right size and shape for returns
2308
- size , shape = singlediode_methods ._get_size_and_shape (args )
2308
+ size , shape = pvlib . singlediode ._get_size_and_shape (args )
2309
2309
if size <= 1 :
2310
2310
if shape is not None :
2311
2311
I = np .tile (I , shape )
0 commit comments