Repository navigation
fix erbs near zenith=90 - #683
Conversation
|
Merging tomorrow unless anyone speaks up... |
cwhanse
left a comment
There was a problem hiding this comment.
Just a thought for the future: if we find another place where the bad_data filter is needed, I suggest that a helper function would be useful.
| * `erbs` DataFrame vs. OrderedDict return behavior now determined by type | ||
| of `datetime_or_doy` instead of `ghi` or `zenith`. | ||
| * Added `min_cos_zenith` and `max_zenith` keyword arguments to `erbs`. | ||
| (:issue:`681`) |
There was a problem hiding this comment.
might need double ticks here (and below) for ReStructured Text - this always get's me - single ticks is for markdown
* func:`~pvlib.irradiance.erbs.erbs` ``doy`` argument changed to ``datetime_or_doy`` to be consistent with
allowed types and similar functions (``disc``, ``get_extra_radiation``).
* func:`~pvlib.irradiance.erbs.erbs` DataFrame vs. OrderedDict return behavior now determined by type
of ``datetime_or_doy`` instead of ``ghi`` or ``zenith``.
* Added ``min_cos_zenith`` and ``max_zenith`` keyword arguments to func:`~pvlib.irradiance.erbs.erbs`.
(:issue:`681`)There was a problem hiding this comment.
The Python docs seem to consistently use italics for parameters and links for functions. I don't think we have a standard here (though I recall you've done some work on this in older whats new files).
There was a problem hiding this comment.
I think in rst single ticks get interpreted as italics just like * do, anyway, not a blocker for me, so I defer to you, everything else looks great! Thanks for checking closure on ghi = dni*cos(ze)+dhi 😸
| * pvwatts_ac raised ZeroDivisionError when called with scalar pdc=0 | ||
| and a RuntimeWarning for array(0) input. Now correctly returns 0s | ||
| of the appropriate type. (:issue:`675`) | ||
| * Fixed `erbs` behavior when zenith is near 90 degrees. (:issue:`681`) |
There was a problem hiding this comment.
double ticks for rst or use func directive to erbs in api
| kt = ghi / i0_h | ||
| kt = np.maximum(kt, 0) | ||
| kt = clearness_index(ghi, zenith, dni_extra, min_cos_zenith=min_cos_zenith, | ||
| max_clearness_index=1) |
| bad_values = (zenith > max_zenith) | (ghi < 0) | (dni < 0) | ||
| dni = np.where(bad_values, 0, dni) | ||
| # ensure that closure relationship remains valid | ||
| dhi = np.where(bad_values, ghi, dhi) |
mikofski
left a comment
There was a problem hiding this comment.
- looks great, very detailed testing, thanks! 🚀
- check the rst markup in what's new
- agree with @cwhanse if bad behavior checks become commonplace, then a helper and perhaps some top-level constants for
min_cos_zenithandmax_zenithdefaults could be nice too

docs/sphinx/source/api.rstfor API changes.docs/sphinx/source/whatsnewfile for all changes.