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

Code and example for classifying snow effects #209

Merged
merged 84 commits into from
Oct 16, 2024
Merged

Conversation

cwhanse
Copy link
Member

@cwhanse cwhanse commented Apr 8, 2024

  • Closes Quantify power losses due to snow cover #200
  • Added tests to cover all new or modified code.
  • Clearly documented all new API functions with PEP257 and numpydoc compliant docstrings.
  • Added new API functions to docs/api.rst.
  • Non-API functions clearly documented with docstrings or comments as necessary.
  • Adds description and name entries in the appropriate "what's new" file
    in docs/whatsnew
    for all changes. Includes link to the GitHub Issue with :issue:`num`
    or this Pull Request with :pull:`num`. Includes contributor name
    and/or GitHub username (link with :ghuser:`user`).
  • Pull request is nearly complete and ready for detailed review.
  • Maintainer: Appropriate GitHub Labels and Milestone are assigned to the Pull Request and linked Issue.

Copy link
Member

@kandersolar kandersolar left a 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.

docs/whatsnew/0.2.1.rst Outdated Show resolved Hide resolved
docs/whatsnew/0.2.1.rst Show resolved Hide resolved
docs/examples/snow-detection/snow-mode.py Outdated Show resolved Hide resolved
docs/examples/snow-detection/snow-mode.py Outdated Show resolved Hide resolved
Comment on lines 98 to 101
.. [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`
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
.. [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.

Copy link
Member

Choose a reason for hiding this comment

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

This comment is still unresolved

docs/examples/snow-detection/snow-mode.py Outdated Show resolved Hide resolved
docs/examples/snow-detection/snow-mode.py Outdated Show resolved Hide resolved
docs/examples/snow-detection/snow-mode.py Outdated Show resolved Hide resolved
Comment on lines 427 to 428
Keys are ``'transmission'``, ``'modeled_vmp'``, ``'vmp_ratio'``,
and ``'mode'``
Copy link
Member

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

Copy link
Member

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?

Copy link
Member

Choose a reason for hiding this comment

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

This Returns description still needs to be updated

docs/examples/snow-detection/snow-mode.py Outdated Show resolved Hide resolved
@cwhanse
Copy link
Member Author

cwhanse commented Sep 27, 2024

Another partial review. High-level thoughts:

  • The gallery example does too much. Simpler would be better.

Thanks for this. I needed an outside perspective, and I will overhaul the example to handle data from a single combiner.

  • 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.

Agreed, but I'm not sure there's an option besides document here, or abandon the PR. A revised reference paper is very unlikely.

@kandersolar
Copy link
Member

Test failure is in test_daytime.py; not caused by this PR. See pvlib/pvlib-python#2238

docs/api.rst Outdated Show resolved Hide resolved
@cwhanse
Copy link
Member Author

cwhanse commented Oct 7, 2024

@kandersolar see if the example is reviewable now.

Copy link
Member

@kandersolar kandersolar left a comment

Choose a reason for hiding this comment

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

The example script is much more accessible now. It's still a bit on the long side, but maybe it has to be.

A few remaining comments (some of which refer to the previous review). Otherwise I think this PR is about ready to merge.

Comment on lines 98 to 101
.. [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`
Copy link
Member

Choose a reason for hiding this comment

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

This comment is still unresolved

Comment on lines 427 to 428
Keys are ``'transmission'``, ``'modeled_vmp'``, ``'vmp_ratio'``,
and ``'mode'``
Copy link
Member

Choose a reason for hiding this comment

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

This Returns description still needs to be updated

Comment on lines 88 to 90
imp0 : float
Short-circuit current at reference condition. [A]

Copy link
Member

Choose a reason for hiding this comment

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

irrad_ref is still undocumented

pvanalytics/tests/features/test_snow.py Outdated Show resolved Hide resolved
@cwhanse
Copy link
Member Author

cwhanse commented Oct 11, 2024

thanks @kandersolar one last look or LGTY?

@kandersolar
Copy link
Member

Yes I think it's time to merge this. Thanks @eccoope and @cwhanse for making this PR happen!

@kandersolar kandersolar merged commit 308c6d2 into pvlib:main Oct 16, 2024
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Quantify power losses due to snow cover
3 participants