Skip to content

avoid and silence warnings #698

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

Merged
merged 11 commits into from
May 6, 2019
Merged

avoid and silence warnings #698

merged 11 commits into from
May 6, 2019

Conversation

wholmgren
Copy link
Member

@wholmgren wholmgren commented May 3, 2019

  • Closes issue #xxxx
  • I am familiar with the contributing guidelines.
  • Fully tested. Added and/or modified tests to ensure correct behavior for all reasonable inputs. Tests (usually) must pass on the TravisCI and Appveyor testing services.
  • 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.

Avoid or silence a lot of test warnings, plus a few that users might encounter (klucher and calcparams_desoto divide by 0).

Also some pep8 along the way. Waiting on #697.

@wholmgren wholmgren added this to the 0.6.2 milestone May 3, 2019
Copy link
Member

@cwhanse cwhanse left a comment

Choose a reason for hiding this comment

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

Lots of format fixes !

@wholmgren
Copy link
Member Author

wholmgren commented May 3, 2019

Warnings status:

  • py27-min: 2 old numpy warnings. let's overlook this.
  • py27: forecast.py import warning (fix this). forecast's NDFD and HRRR_ESRL models produce warnings (maybe silence). pvfactors uses deprecated pvlib api -- maybe pvfactors 1.0.0 fixes this, but it's not compatible with our wrapper. cc @anomam
  • py34: all of py27 plus invalid warning in test_ashraeiam_scalar. maybe does not warning invalid values in np.minimum and np.maximum because it's using very old pandas and numpy and this was a more recent problem. We should drop this build soon anyways.
  • py35: all of py27 plus warnings about invalid values in np.minimum and np.maximum because conda-forge supplies only numpy 1.15 for python 3.5.
  • py36: same as py27
  • py37: only pvfactors warnings (this build doesn't test forecast.py).

To do:

  • silence forecast.py import warnings
  • look into NDFD and HRRR_ESRL warnings
  • overlook everything else

Lots of format fixes !

Yeah :( Trying to strike a compromise with my IDE's linter. The stickler objections here are wrong. Maybe a flake8 bug.

warnings.simplefilter("ignore")
result = irradiance.get_extra_radiation(times, method='nrel',
how='numba',
numthreads=4)
Copy link
Member

Choose a reason for hiding this comment

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

since you're making formatting changes, possibly consider:

result = irradiance.get_extra_radiation(
    times, method='nrel', how='numba', numthreads=4)

this is blacker code, tho not quite completely Black

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree this better formatting in this case. Overall, I prefer the grey zone.

@mikofski
Copy link
Member

mikofski commented May 3, 2019

Everything lgtm so far, thanks!

@wholmgren
Copy link
Member Author

@cwhanse ready to merge if you approve of the last few commits. I'd like to keep the pvfactors and forecast.HRRR_ESRL warnings as a reminder of work to do.

@wholmgren wholmgren merged commit f4bbac8 into pvlib:master May 6, 2019
@wholmgren wholmgren deleted the tidying branch May 6, 2019 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants