Skip to content

Document per-cell capacity factor extraction with capacity_factor_timeseries#481

Open
MaykThewessen wants to merge 3 commits intoPyPSA:masterfrom
MaykThewessen:docs/per-cell-capacity-factor-extraction
Open

Document per-cell capacity factor extraction with capacity_factor_timeseries#481
MaykThewessen wants to merge 3 commits intoPyPSA:masterfrom
MaykThewessen:docs/per-cell-capacity-factor-extraction

Conversation

@MaykThewessen
Copy link

@MaykThewessen MaykThewessen commented Mar 3, 2026

Closes #480.

Changes proposed in this Pull Request

  • Documents the existing but undocumented capacity_factor_timeseries=True behavior for per-cell extraction (without matrix/shapes/layout)
  • Updates convert_and_aggregate docstring with structured return value documentation covering all code paths
  • Adds usage examples to wind() and pv() showing per-cell extraction alongside the existing matrix-based workflow
  • Fixes RST formatting (backtick → double-backtick) in several parameter descriptions

No functional code changes — documentation only.

Checklist

  • Code changes are sufficiently documented; i.e. new functions contain docstrings and further explanations may be given in doc.
  • Unit tests for new features were added (if applicable).
  • Newly introduced dependencies are added to environment.yaml, environment_docs.yaml and setup.py (if applicable).
  • A note for the release notes doc/release_notes.rst of the upcoming release is included.
  • I consent to the release of this PR's code under the MIT license.

MaykThewessen and others added 2 commits March 3, 2026 17:17
The `capacity_factor_timeseries=True` parameter already supports per-cell
extraction when called without matrix/shapes/layout, but this behavior was
undocumented. This commit:

- Updates convert_and_aggregate docstring to document per-cell return values
- Adds usage examples to wind() and pv() showing per-cell extraction
- Adds Cutout.profiles_at_points() convenience method for extracting
  capacity factor time series at specific (lon, lat) coordinates

Closes PyPSA#480

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@FabianHofmann
Copy link
Contributor

did not see the pr yet (see the other comment in #480). let me have a look later.

there is one general thing I need to think about. the profiles_at_points now start to abstract the conversion functions, ie uses it, sets parameters. such a ting is good and will facilitate the use of the tool in future as the convert and aggregate function is way to complicated. however if we go into that direction, we would make sure to generalize it as much as possible. perhaps an accessor structure could already help out

cutout.pv.pofiles_at_points
cutout.wind.

that said, could we remove the profiles_at_points function for now from the pr and make this a doc fix only? we can open up a discussion how to abstract the usage of convert_and_aggregate in a separate issue

@FabianHofmann
Copy link
Contributor

FabianHofmann commented Mar 4, 2026

also when you generate pr/issues with CC, please make sure the bot follows the templates(!) they are in .github/

@MaykThewessen
Copy link
Author

MaykThewessen commented Mar 4, 2026

on "remove profiles_at_points" comment:

Makes sense — I'll strip out profiles_at_points and keep this as a pure documentation fix. I'll open a separate issue for the API discussion around cutout.pv(points=...) vs accessor patterns.

on "follow templates" comment:

Noted — apologies for that. I'll update the PR description to follow the .github/pull_request_template.md format and will make sure to use the templates going forward.

@MaykThewessen MaykThewessen changed the title Document per-cell capacity factor extraction and add profiles_at_points Document per-cell capacity factor extraction with capacity_factor_timeseries Mar 4, 2026
Copy link
Contributor

@FabianHofmann FabianHofmann left a comment

Choose a reason for hiding this comment

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

wonderful! if you now could just add a release note I can merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: support efficient per-cell capacity factor time series extraction

2 participants