-
Notifications
You must be signed in to change notification settings - Fork 1k
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
BUG: netcdf4 conversion error in forecast.py #944
Comments
Duplicate of #920? |
FWIW I cannot reproduce the errors on my machine. Maybe not relevant, but just in case: #900 handled the cftime change that added |
Downgrading cftime from 1.1.1 to 1.0.4 solved this issue for me. |
That did it for me. Thanks, @augustecolle! |
@CameronTStark do you still see this problem when using pvlib/pvlib-python/master? I think @kanderso-nrel's suggestion might have fixed it and #947 might be unnecessary. Sorry I got confused about which issue to reference. |
Describe the bug
The method
get_data()
from the parent classForecastModel
has a handling NETCDF data. It produces the following error on multiple tests withintest_forecast.py
:TypeError: <class 'cftime._cftime.DatetimeGregorian'> is not convertible to datetime
To Reproduce
Run the command locally:
pytest pvlib/tests/test_forecast.py --remote-data --pdb
This command will ensure the tests marked as
remote_data
are run and you'll be dropped into a pdb debugger.Expected behavior
The formatted data would be received without error.
Screenshots
If applicable, add screenshots to help explain your problem.
Versions:
pvlib.__version__
: 0.7.1 masterpandas.__version__
: 1.0.3Additional context
I'm unsure about the underlying origin but the disconnect seems to come through
get_data()
->_netcdf2pandas()
->set_time()
wherenum2date
supplies a DatetimeGregorian that Pandas can't process.It's notable that there is a suggestion on line 279 of forecast.py about the potential to move to xarray's implementation of NetCDF rather than using the
_netcdf2pandas()
method. This avenue likely has the potential to be easier than continuing a pvlib implementation.The text was updated successfully, but these errors were encountered: