Skip to content
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

Add kwargs to forecast.get_data with tests #746

Merged
merged 6 commits into from
Jul 10, 2019
Merged

Add kwargs to forecast.get_data with tests #746

merged 6 commits into from
Jul 10, 2019

Conversation

odow
Copy link
Contributor

@odow odow commented Jul 3, 2019

pvlib python pull request guidelines

Running locally, I get some warnings. Should I fix these? Also, the tests take 60 seconds on my machine which seems a bit long for this one file. Shall I merge some tests? Or any other ideas for speeding it up?

(tonopah) Oscars-MBP:pvlib-python oscar$ pytest pvlib/test/test_forecast.py
============================= test session starts ==============================
platform darwin -- Python 3.7.3, pytest-5.0.0, py-1.8.0, pluggy-0.12.0
rootdir: /Users/oscar/Documents/Code/pvlib-python
plugins: mock-1.10.4
collected 18 items                                                             

pvlib/test/test_forecast.py .....X............                           [100%]

=============================== warnings summary ===============================
/anaconda3/envs/tonopah/lib/python3.7/site-packages/_pytest/mark/structures.py:332
  /anaconda3/envs/tonopah/lib/python3.7/site-packages/_pytest/mark/structures.py:332: PytestUnknownMarkWarning: Unknown pytest.mark.timeout - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html
    PytestUnknownMarkWarning,

pvlib/test/test_forecast.py::test_process_data[HRRR_ESRL]
  /Users/oscar/Documents/Code/pvlib-python/pvlib/test/test_forecast.py:56: UserWarning: Exception getting data for GSD HRRR CONUS 3km surface, best.
  latitude, longitude, start, end = 32.2 -110.9 2019-07-02 20:21:41.477024-07:00 2019-07-03 20:21:41.477024-07:00
  Error accessing https://thredds.ucar.edu/thredds/ncss/grib/HRRR/CONUS_3km/surface/Best?var=Medium_cloud_cover_UnknownLevelType-224&var=Total_cloud_cover_entire_atmosphere&var=High_cloud_cover_UnknownLevelType-234&var=Downward_short-wave_radiation_flux_surface&var=Temperature_surface&var=Wind_speed_gust_surface&var=Low_cloud_cover_UnknownLevelType-214&time_start=2019-07-02T20%3A21%3A41.477024-07%3A00&time_end=2019-07-03T20%3A21%3A41.477024-07%3A00&longitude=-110.9&latitude=32.2&accept=netcdf
  Server Error (400: Requested time range 2019-07-03T03:21:41.477Z - 2019-07-04T03:21:41.477Z does not intersect actual time range 2019-06-29T00:01:00Z - 2019-07-02T23:36:00Z)
    .format(amodel, _latitude, _longitude, _start, _end, e))

pvlib/test/test_forecast.py::test_process_data[HRRR_ESRL]
  /Users/oscar/Documents/Code/pvlib-python/pvlib/test/test_forecast.py:67: UserWarning: Could not test GSD HRRR CONUS 3km surface, best process_data with how=liujordan because raw_data was empty
    'because raw_data was empty'.format(model, how))

pvlib/test/test_forecast.py::test_process_data[HRRR_ESRL]
  /Users/oscar/Documents/Code/pvlib-python/pvlib/test/test_forecast.py:67: UserWarning: Could not test GSD HRRR CONUS 3km surface, best process_data with how=clearsky_scaling because raw_data was empty
    'because raw_data was empty'.format(model, how))

-- Docs: https://docs.pytest.org/en/latest/warnings.html
============== 17 passed, 1 xpassed, 4 warnings in 66.84 seconds ===============
  • Updates entries to docs/sphinx/source/api.rst for API changes.
  • Adds description and name entries in the appropriate docs/sphinx/source/whatsnew file for all changes.
  • Code quality and style is sufficient. Passes LGTM and SticklerCI checks.
  • New code is fully documented. Includes sphinx/numpydoc compliant docstrings and comments in the code where necessary.
  • Pull request is nearly complete and ready for detailed review.

@cwhanse
Copy link
Member

cwhanse commented Jul 9, 2019

@odow don't worry about the np.maximum/minimum warnings. The test failure you posted appears to be a server not responding. Please merge master now with #748, that should fix the py35-min build failure.

@odow
Copy link
Contributor Author

odow commented Jul 9, 2019

So tests are passing, but the codecov failed because these lines weren't hit. I copied them from elsewhere in the file. What is your policy on codecov needing to pass for tests?

Copy link
Member

@wholmgren wholmgren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a few minor things below...

I don't understand why the diff coverage test fails. I think it's ok to ignore it.

pvlib/test/test_forecast.py Show resolved Hide resolved
pvlib/test/test_forecast.py Outdated Show resolved Hide resolved
@wholmgren
Copy link
Member

Ah, I missed your comment when finishing my review. This PR is about fixing an API issue. I don't think it's important that it tests details of the returned data.

@wholmgren wholmgren added this to the 0.7.0 milestone Jul 9, 2019
@cwhanse cwhanse merged commit aaf33eb into pvlib:master Jul 10, 2019
@odow odow deleted the od/get_data branch July 10, 2019 15:00
@wholmgren
Copy link
Member

Thanks @odow!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

forecast.get_data doesn't allow extra kwargs
3 participants