-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
Describe the bug
forecast.get_processed_data accepts **kwargs (good) and passes these to get_data (good) and process_data (good):
pvlib-python/pvlib/forecast.py
Line 306 in 91c6a55
| return self.process_data(self.get_data(*args, **kwargs), **kwargs) |
but
get_data doesn't allow superfluous keyword arguments (bad):pvlib-python/pvlib/forecast.py
Lines 202 to 204 in 91c6a55
| def get_data(self, latitude, longitude, start, end, | |
| vert_level=None, query_variables=None, | |
| close_netcdf_data=True): |
Is the fix just to add **kwargs as the last argument to get_data? If so, you can assign this issue to me and I'll make a PR.
To Reproduce
import datetime
import pandas
from pvlib import forecast
forecast.NDFD().get_processed_data(
38.238875, -117.363598,
pandas.Timestamp(datetime.datetime.now(), tz='US/Central'),
pandas.Timestamp(datetime.datetime.now(), tz='US/Central') + pandas.Timedelta(hours = 12),
how = 'liujordan'
)Yields
Traceback (most recent call last):
File "<stdin>", line 5, in <module>
File "/anaconda3/envs/tonopah/lib/python3.7/site-packages/pvlib/forecast.py", line 306, in get_processed_data
return self.process_data(self.get_data(*args, **kwargs), **kwargs)
TypeError: get_data() got an unexpected keyword argument 'how'Expected behavior
I expect that get_processed_data is equivalent to:
model = forecast.NDFD()
data = model.get_data(
38.238875, -117.363598,
pandas.Timestamp(datetime.datetime.now(), tz='US/Central'),
pandas.Timestamp(datetime.datetime.now(), tz='US/Central') + pandas.Timedelta(hours = 12)
)
model.process_data(data, how = 'liujordan', extra_kwarg=False)Note how I can pass extra_kwarg without any problem.
Versions:
pvlib.__version__: 0.6.3pandas.__version__: 0.24.2- python: 3.7.3