Skip to content

Repair broken link in get_pvgis_hourly documentation #2517

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 3 commits into from
Jul 31, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pvlib/iotools/pvgis.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def get_pvgis_hourly(latitude, longitude, start=None, end=None,
.. [2] `PVGIS Hourly Radiation
<https://ec.europa.eu/jrc/en/PVGIS/tools/hourly-radiation>`_
.. [3] `PVGIS Non-interactive service
<https://ec.europa.eu/jrc/en/PVGIS/docs/noninteractive>`_
<https://joint-research-centre.ec.europa.eu/photovoltaic-geographical-information-system-pvgis/getting-started-pvgis/api-non-interactive-service_en>`_
.. [4] `PVGIS horizon profile tool
<https://ec.europa.eu/jrc/en/PVGIS/tools/horizon>`_
""" # noqa: E501
Expand Down
2 changes: 1 addition & 1 deletion pvlib/modelchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ def with_pvwatts(cls, system, location,

>>> pvwatts_losses = {'soiling': 2, 'shading': 3, 'snow': 0, 'mismatch': 2,
>>> 'wiring': 2, 'connections': 0.5, 'lid': 1.5,
>>> 'nameplate_rating': 1, 'age': 0, 'availability': 30}
>>> 'nameplate_rating': 1, 'age': 0, 'availability': 3}
Copy link
Member

Choose a reason for hiding this comment

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

I see how 30 might have meant 3, but now these add up to 15% rather than the 14% stated in the docstring, so should this be 2 rather than 3, or is something else (the docstring?) wrong here?
@cwhanse @kandersolar ?

Suggested change
>>> 'nameplate_rating': 1, 'age': 0, 'availability': 3}
>>> 'nameplate_rating': 1, 'age': 0, 'availability': 2}

Copy link
Contributor Author

@ramaroesilva ramaroesilva Jul 30, 2025

Choose a reason for hiding this comment

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

Had the same question myself @RDaxini ahaha

Had to google it to remind myself that the loss factors are not additive but multiplicative. So if you do (1-loss_factor) for each source and then multiply all of them you get something like 0.859 (i.e., 14% overall loss)

I thought of adding a remark on this to the documentation, but then I thought reviewers could find it a bit unnecessary....

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for clarifying, that's my mistake! You can mark this conversation as resolved, and then one of the other maintainers will approve workflows and double check the PR before merging.

Copy link
Member

Choose a reason for hiding this comment

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

Indeed PVWatts losses combine multiplicatively; see the source code of pvlib.pvsystem.pvwatts_losses.

Regarding the typo: from the comment immediately above the dict, it looks like those parameter values are not supposed to reflect the defaults but rather an example set of user-specified values. I think the 30 was intentional then, and it defeats the purpose of the example to change it back to the default value :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree with @kandersolar remark. Can you confirm if the workflow is what I should do now?

  • revert the typo that wasn't a typo, commit locally and then push to my repository

Copy link
Member

Choose a reason for hiding this comment

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

  • revert the typo that wasn't a typo, commit locally and then push to my repository

Sounds correct to me:)
You can make the change manually in the file, or I think there is a function in git to revert a specific commit too. Either is fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@RDaxini @kandersolar should be good to go :-)

>>> system_with_custom_losses = pvsystem.PVSystem(
>>> surface_tilt=30, surface_azimuth=180,
>>> module_parameters=module_parameters,
Expand Down