Added new PV node and improved documentation.#11
Conversation
There was a problem hiding this comment.
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/PVParameterstypes and a PVGIS-backed constructor that builds anOperationalProfilefrom 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.
JulStraus
left a comment
There was a problem hiding this comment.
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.
Co-authored-by: Julian Straus <[email protected]>
Zetison
left a comment
There was a problem hiding this comment.
Thanks for your feedback! I have adjusted for most of your input.
JulStraus
left a comment
There was a problem hiding this comment.
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
Zetison
left a comment
There was a problem hiding this comment.
I made some suggestions to accomidate the review in a new commit.
JulStraus
left a comment
There was a problem hiding this comment.
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...):
- We should test that our checks in the internal constructor for
PVParametersare 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. - 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.
|
Correction to my self, we actually test the local profile version due to running the test loop twice. |
This PR adds a
PVnode 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.