Skip to content

Added new PV node and improved documentation.#11

Merged
Zetison merged 10 commits into
mainfrom
enhance/add_PV
May 7, 2026
Merged

Added new PV node and improved documentation.#11
Zetison merged 10 commits into
mainfrom
enhance/add_PV

Conversation

@Zetison
Copy link
Copy Markdown
Collaborator

@Zetison Zetison commented Apr 17, 2026

This PR adds a PV node to the package, which provides sampling routines for photovoltaic power generation using PVGIS which is more in line with the WindPower node requiring lat-lon coordinates.

@Zetison Zetison requested a review from Copilot April 17, 2026 14:41
@Zetison Zetison self-assigned this Apr 17, 2026
@Zetison Zetison added the enhancement New feature or request label Apr 17, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a new PV node that can sample photovoltaic generation profiles via the PVGIS seriescalc API, aligning PV sampling with the lat/lon workflow used by WindPower, and adds documentation + tests around the new node.

Changes:

  • Added PV / PVParameters types and a PVGIS-backed constructor that builds an OperationalProfile from PVGIS hourly output.
  • Implemented pvgis_profile(...) with local CSV caching and added PV-specific node checks.
  • Added PV documentation and test coverage, and enabled JuliaFormatter checks in the test run.

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
src/datastructures.jl Adds PVParameters and PV node types plus a PVGIS-sampling constructor.
src/utils.jl Adds pvgis_profile(...) to call PVGIS, parse JSON, and cache results to CSV.
src/checks.jl Adds EMB.check_node(::PV, ...) to enforce profile bounds.
src/EnergyModelsLanguageInterfaces.jl Imports PVGIS-related deps and exports PV / PVParameters.
docs/src/nodes/pv.md New documentation page for the PV node.
test/utils.jl Adds simple_graph_pv(...) helper to build a minimal PV test case.
test/test_checks.jl Adds validation tests for PV input checks.
test/test_PV.jl Adds a PV node integration test.
test/runtests.jl Enables JuliaFormatter test and includes test_PV.jl.
test/test_CSPandPV.jl Minor formatting change to an assertion line.
Project.toml Adds PVGIS-related dependencies and compat constraints.
NEWS.md Updates release notes with the new PV node.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/checks.jl Outdated
Comment thread test/runtests.jl
Comment thread src/utils.jl
Comment thread src/utils.jl Outdated
Comment thread test/utils.jl
Comment thread test/test_PV.jl Outdated
Comment thread src/utils.jl Outdated
Comment thread src/utils.jl
Comment thread src/datastructures.jl Outdated
@Zetison Zetison requested review from JulStraus April 20, 2026 15:06
Copy link
Copy Markdown
Member

@JulStraus JulStraus left a comment

Choose a reason for hiding this comment

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

I like the idea in general. There are however some structural points within the sampling which I would like you to address. Specifically, I think it would be good to have a hard coded test profile as well to see if there is stuff changing at the source. Note that I think it is also important to check that existing functions are working.

Important

JSON3.jl is deprecated as written in its README.md: https://github.com/quinnj/JSON3.jl. This implies we should use JSON.jl from the start.

Comment thread src/utils.jl Outdated
Comment thread src/utils.jl Outdated
Comment thread src/utils.jl Outdated
Comment thread src/utils.jl
Comment thread src/utils.jl Outdated
Comment thread src/utils.jl
Comment thread src/datastructures.jl
Comment thread src/utils.jl
Comment thread Project.toml Outdated
Comment thread src/utils.jl
Copy link
Copy Markdown
Collaborator Author

@Zetison Zetison left a comment

Choose a reason for hiding this comment

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

Thanks for your feedback! I have adjusted for most of your input.

Comment thread src/utils.jl Outdated
Comment thread src/datastructures.jl
Comment thread src/datastructures.jl
Comment thread src/utils.jl Outdated
Comment thread src/utils.jl
Copy link
Copy Markdown
Member

@JulStraus JulStraus left a comment

Choose a reason for hiding this comment

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

There are minor things to be adjusted. I think we are soon there.

Important

We have to allow the user to specify the unit for the capacity in PVParameters. Currently, we assume it to be kW while potential users would be more interested in other units. It seems to me that PVGIS requires kW for peakpower, but it would be beneficial for us to have a different approach

Comment thread src/datastructures.jl
Comment thread src/datastructures.jl Outdated
Comment thread src/datastructures.jl
Comment thread test/test_PV.jl
Comment thread src/utils.jl
Comment thread src/utils.jl
Comment thread docs/src/nodes/pv.md
Copy link
Copy Markdown
Collaborator Author

@Zetison Zetison left a comment

Choose a reason for hiding this comment

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

I made some suggestions to accomidate the review in a new commit.

Comment thread src/datastructures.jl
Comment thread src/datastructures.jl Outdated
Comment thread src/utils.jl
Comment thread src/utils.jl
@Zetison Zetison requested a review from JulStraus May 5, 2026 11:40
Copy link
Copy Markdown
Member

@JulStraus JulStraus left a comment

Choose a reason for hiding this comment

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

I think we are soon there. I have no comments regarding your changes as you pretty much implemented what I asked for.

There are however two things I would like you to include in the test set (and which I unfortunately forgot the last time...):

  1. We should test that our checks in the internal constructor for PVParameters are working. In addition, we should test that the constructor is working. The latter could be similar to the approaches I chose in, e.g., EnergyModelsFlex.
  2. We do not test that the reading of local profile files is working, at least I do not see it. It is in my opinion however an important point to test it.

Both tests should be within the file test_PV.jl in my opinion.

@JulStraus
Copy link
Copy Markdown
Member

Correction to my self, we actually test the local profile version due to running the test loop twice.

@Zetison Zetison requested a review from JulStraus May 6, 2026 14:43
Copy link
Copy Markdown
Member

@JulStraus JulStraus left a comment

Choose a reason for hiding this comment

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

Looks good to me now.

@Zetison Zetison merged commit 771282a into main May 7, 2026
5 checks passed
@JulStraus JulStraus deleted the enhance/add_PV branch May 7, 2026 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants