Python PVLIB error 'erbs() got an unexpected keyword argument 'min_cos_zenith''

冷暖自知 提交于 2019-12-11 18:22:31

问题


I run the following code to estimate DNI and DHI from GHI using the Erbs model available in Sandia's PVLIB.

The original code as here is:

pvlib.irradiance.erbs(ghi, zenith, datetime_or_doy, min_cos_zenith=0.065, max_zenith=87)

My code is:

df= pvlib.irradiance.erbs(df.ghi, sun.zenith, df.index, min_cos_zenith=0.065, max_zenith=85)

But my code returns erbs() got an unexpected keyword argument 'min_cos_zenith'. Any help is appreciated.

I use:
Python 3.7.3
PVLIB 0.6.1
Pandas 0.24.2

EDIT:
Maybe the solution is to upgrade to PVLIB v0.6.2. But, how to upgrade it. In my machine, none of the following works: pip install pvlib, pip install --upgrade pvlib, pip install pvliv ==0.6.2


回答1:


Just call the function without the new (optional) arguments:

df= pvlib.irradiance.erbs(df.ghi, sun.zenith, df.index)




回答2:


AS of 2019-04-28 the pvlib version was v0.6.1 which does not yet have the min_cos_zenith optional argument for erbs(). As Will Holmgren commented, a workaround in the meantime would be to install the latest master from GitHub using pip vcs support:

$ pip install -e git+https://github.com/pvlib/pvlib-python.git@master#egg=pvlib


来源:https://stackoverflow.com/questions/55775990/python-pvlib-error-erbs-got-an-unexpected-keyword-argument-min-cos-zenith

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!