-
Notifications
You must be signed in to change notification settings - Fork 31
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
Code and example for classifying snow effects #209
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's a review of the new functions. FYI I anticipate at least one more round of review after this one is done.
Co-authored-by: Kevin Anderson <kevin.anderso@gmail.com>
Co-authored-by: Kevin Anderson <kevin.anderso@gmail.com>
Co-authored-by: Kevin Anderson <kevin.anderso@gmail.com>
Co-authored-by: Kevin Anderson <kevin.anderso@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another partial review. High-level thoughts:
- The gallery example does too much. Simpler would be better. I think reducing it to a single inverter, or even a single combiner box, would be an improvement. I also think getting rid of unnecessary steps (e.g. horizon, SDM) would help.
- I am a little uncomfortable with the functions being only loosely tied to the reference (at least by pvlib-python standards). The code both extends the reference (e.g. adding a new mode) and fills in many gaps where the reference doesn't give specifics. It seems that these changes are necessary, so maybe all we can do is document the differences.
data['Horizon Mask'] = snow._get_horizon_mask(horizon, data['azimuth'], | ||
data['elevation']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this function should live in pvanalytics.snow
, and I'm not sure it needs to be in pvanalytics
at all. If the horizon filter is retained, should this function be converted to a helper function here in the script?
.. [1] C. F. Abe, J. B. Dias, G. Notton, G. A. Faggianelli, G. Pigelet, and | ||
D. Ouvrard, David, "Estimation of the effective irradiance and bifacial | ||
gain for PV arrays using the maximum power current", IEEE Journal of | ||
Photovoltaics, 2022, pp. 432-441. :doi:`10.1109/JPHOTOV.2023.3242117` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.. [1] C. F. Abe, J. B. Dias, G. Notton, G. A. Faggianelli, G. Pigelet, and | |
D. Ouvrard, David, "Estimation of the effective irradiance and bifacial | |
gain for PV arrays using the maximum power current", IEEE Journal of | |
Photovoltaics, 2022, pp. 432-441. :doi:`10.1109/JPHOTOV.2023.3242117` | |
.. [1] C. F. Abe, J. B. Dias, G. Notton, G. A. Faggianelli, G. Pigelet, | |
and D. Ouvrard, "Estimation of the effective irradiance and bifacial | |
gain for PV arrays using the maximum power current", IEEE Journal of | |
Photovoltaics, 2022, pp. 432-441. :doi:`10.1109/JPHOTOV.2023.3242117` |
Something weird is happening with the rendering here. I am guessing sphinx is interpreting the leading C.
and D.
as indicating an enumerated list. I'm not sure, but I think this tweak (not having D.
at the start of the second line) might get sphinx to render it as intended.
data['Module Temp [C]'], data['POA [W/m²]'], 3) | ||
|
||
# %% | ||
# Plot cell temperature |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this plot adds much. I would remove it, again to simplify things.
# Approach 2 %TODO not sure we need this | ||
# Code borrowed from pvlib-python/docs/examples/iv-modeling/plot_singlediode.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again for simplification, I suggest calculating voltage only one way. The other way could be briefly mentioned as an alternative.
# %% | ||
# Function to do analysis so we can loop over combiner boxes | ||
|
||
def wrapper(voltage, current, temp_cell, effective_irradiance, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrapper
is not a very informative name. get_snow_mode
, perhaps?
Keys are ``'transmission'``, ``'modeled_vmp'``, ``'vmp_ratio'``, | ||
and ``'mode'`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These keys need to be updated according to what the function actually returns
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, maybe return a dataframe instead of a dict?
|
||
# %% | ||
# Demonstrate transmission, modeled voltage calculation and mode categorization | ||
# on voltage, current pair |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this cell is necessary; it's just a copy of the body of the for loop in the next cell.
Suggestions from review Co-authored-by: Kevin Anderson <kevin.anderso@gmail.com>
Thanks for this. I needed an outside perspective, and I will overhaul the example to handle data from a single combiner.
Agreed, but I'm not sure there's an option besides document here, or abandon the PR. A revised reference paper is very unlikely. |
Test failure is in |
docs/api.rst
.in
docs/whatsnew
for all changes. Includes link to the GitHub Issue with
:issue:`num`
or this Pull Request with
:pull:`num`
. Includes contributor nameand/or GitHub username (link with
:ghuser:`user`
).