8000 Add method to fit Huld model by cwhanse · Pull Request #1979 · pvlib/pvlib-python · GitHub
[go: up one dir, main page]

Skip to content

Add method to fit Huld model #1979

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
lint
  • Loading branch information
cwhanse committed Apr 4, 2024
commit 1250bcd01f54276f14be1ae04f2864f6373f8c9b
4 changes: 2 additions & 2 deletions pvlib/pvarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,9 @@ def fit_huld(effective_irradiance, temp_module, pdc, method='ols'):
tprime*logGprime**2, tprime**2), axis=0).T
X = sm.add_constant(X)

if method=='ols':
if method == 'ols':
model = sm.OLS(Y, X, missing='drop')
elif method=='robust':
elif method == 'robust':
model = sm.RLM(Y, X, missing='drop')
else:
raise ValueError("method must be ols or robust")
Expand Down
2 changes: 1 addition & 1 deletion pvlib/tests/test_pvarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,6 @@ def test_fit_huld_method_error():
ee, tc = pvarray._build_iec61853()
pdc0 = 250
pdc = pvarray.huld(ee, tc, pdc0, cell_type='csi')
method='brute_force'
method = 'brute_force'
with pytest.raises(ValueError, match="method must be ols or robust"):
m_pdc0, k = pvarray.fit_huld(ee, tc, pdc, method=method)
0