Skip to content

Fix PVGIS TMY tests #2305

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 4 commits into from
Nov 27, 2024
Merged

Fix PVGIS TMY tests #2305

merged 4 commits into from
Nov 27, 2024

Conversation

kandersolar
Copy link
Member

  • Closes PVGIS tests are failing #2221
  • I am familiar with the contributing guidelines
  • Tests added
  • [ ] Updates entries in docs/sphinx/source/reference for API changes.
  • Adds description and name entries in the appropriate "what's new" file in docs/sphinx/source/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`).
  • [ ] New code is fully documented. Includes numpydoc compliant docstrings, examples, and comments where necessary.
  • Pull request is nearly complete and ready for detailed review.
  • Maintainer: Appropriate GitHub Labels (including remote-data) and Milestone are assigned to the Pull Request and linked Issue.

PVGIS TMY test files were recently updated in #2222. For some reason, PVGIS seems to have generated new TMY data with different values. It has been at least a month since the change (#2221 (comment)). This PR updates our files again so that they match the data currently returned by PVGIS. Hopefully it doesn't change again soon... otherwise we should rethink how we test these functions!

Side note: it seems that the "basic" format is not able to be requested via the PVGIS online interface. I was only able to get a "basic" file by "hacking" the website to submit a custom request where I manually specified basic as the file format. The API docs still list it as a supported format, though.

@kandersolar kandersolar added this to the v0.11.2 milestone Nov 25, 2024
@kandersolar kandersolar added the remote-data triggers --remote-data pytests label Nov 25, 2024
@kandersolar
Copy link
Member Author

@AdamRJensen the get_pvgis_tmy docstring says:

Note
----
The PVGIS website uses 10 years of data to generate the TMY, whereas the
API accessed by this function defaults to using all available years. This
means that the TMY returned by this function may not be identical to the
one generated by the website. To replicate the website requests, specify
the corresponding 10 year period using ``startyear`` and ``endyear``.
Specifying ``endyear`` also avoids the TMY changing when new data becomes
available.

Is this still applicable to the new PVGIS 5.3? I think perhaps not.

@AdamRJensen
Copy link
Member

Is this still applicable to the new PVGIS 5.3? I think perhaps not.

When I run this snippt of code, the metadata says its using year_min=2005 and year_max=2023

data, years, inputs, _ = pvlib.iotools.get_pvgis_tmy(
    latitude=50,
    longitude=10,
    url='https://re.jrc.ec.europa.eu/api/v5_3/',
)

The website returns the same, so you are correct that this notes section is no longer applicable.

@kandersolar kandersolar merged commit d6379ef into pvlib:main Nov 27, 2024
20 of 21 checks passed
@kandersolar kandersolar deleted the pvgis-fix branch November 27, 2024 20:19
@kandersolar kandersolar mentioned this pull request Apr 10, 2025
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
io remote-data triggers --remote-data pytests testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PVGIS tests are failing
2 participants