8000 Merge pull request #67 from wholmgren/privatemethods · djgagne/pvlib-python@375108d · GitHub
[go: up one dir, main page]

Skip to content

Commit 375108d

Browse files
committed
Merge pull request pvlib#67 from wholmgren/privatemethods
make some methods private in pvsystem
2 parents e1e7ce9 + 2bff5ce commit 375108d

File tree

1 file changed

+8
-18
lines changed

1 file changed

+8
-18
lines changed

pvlib/pvsystem.py

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -922,12 +922,12 @@ def singlediode(module, IL, I0, Rs, Rsh, nNsVth, **kwargs):
922922
DFOut['I0'] = I0
923923
DFOut['IL'] = IL
924924

925-
__, Voc_return = golden_sect_DataFrame(DFOut, 0, module.V_oc_ref*1.6,
926-
Voc_optfcn)
925+
__, Voc_return = _golden_sect_DataFrame(DFOut, 0, module.V_oc_ref*1.6,
926+
_Voc_optfcn)
927927
Voc = Voc_return.copy()
928928

929-
Pmp, Vmax = golden_sect_DataFrame(DFOut, 0, module.V_oc_ref*1.14,
930-
pwr_optfcn)
929+
Pmp, Vmax = _golden_sect_DataFrame(DFOut, 0, module.V_oc_ref*1.14,
930+
_pwr_optfcn)
931931
Imax = I_from_V(Rsh=Rsh, Rs=Rs, nNsVth=nNsVth, V=Vmax, I0=I0, IL=IL)
932932
# Invert the Power-Current curve. Find the current where the inverted power
933933
# is minimized. This is Imax. Start the optimization at Voc/2
@@ -963,14 +963,11 @@ def singlediode(module, IL, I0, Rs, Rsh, nNsVth, **kwargs):
963963

964964
# Created April,2014
965965
# Author: Rob Andrews, Calama Consulting
966-
# These may become private methods in 0.2
967966

968-
def golden_sect_DataFrame(df, VL, VH, func):
967+
def _golden_sect_DataFrame(df, VL, VH, func):
969968
'''
970969
Vectorized golden section search for finding MPPT
971970
from a dataframe timeseries.
972-
973-
Do not expect this function to remain in the public API.
974971
975972
Parameters
976973
----------
@@ -1031,27 +1028,22 @@ def golden_sect_DataFrame(df, VL, VH, func):
10311028
if iterations >50:
10321029
raise Exception("EXCEPTION:iterations exeeded maximum (50)")
10331030

1034-
10351031
return func(df,'V1') , df['V1']
10361032

10371033

1038-
def pwr_optfcn(df, loc):
1034+
def _pwr_optfcn(df, loc):
10391035
'''
10401036
Function to find power from I_from_V.
1041-
1042-
Do not expect this function to remain in the public API.
10431037
'''
10441038

10451039
I = I_from_V(Rsh=df['Rsh'], Rs=df['Rs'], nNsVth=df['nNsVth'], V=df[loc],
10461040
I0=df['I0'], IL=df['IL'])
10471041
return I*df[loc]
10481042

10491043

1050-
def Voc_optfcn(df, loc):
1044+
def _Voc_optfcn(df, loc):
10511045
'''
10521046
Function to find V_oc from I_from_V.
1053-
1054-
Do not expect this function to remain in the public API.
10551047
'''
10561048
I = -abs(I_from_V(Rsh=df['Rsh'], Rs=df['Rs'], nNsVth=df['nNsVth'],
10571049
V=df[loc], I0=df['I0'], IL=df['IL']))
@@ -1064,13 +1056,11 @@ def I_from_V(Rsh, Rs, nNsVth, V, I0, IL):
10641056
uses Lambert W implemented in wapr_vec.m
10651057
Rsh, nVth, V, I0, IL can all be DataFrames
10661058
Rs can be a DataFrame, but should be a scalar.
1067-
1068-
Do not expect this function to remain in the public API.
10691059
'''
10701060
try:
10711061
from scipy.special import lambertw
10721062
except ImportError:
1073-
raise ImportError('The I_from_V function requires scipy')
1063+
raise ImportError('This function requires scipy')
10741064

10751065
argW = (Rs*I0*Rsh * np.exp(Rsh*(Rs*(IL+I0)+V) /
10761066
(nNsVth*(Rs+Rsh))) / (nNsVth*(Rs + Rsh)) )

0 commit comments

Comments
 (0)
0