Skip to content

doc: improve docstrings formatting - #759

Merged
tgilon merged 14 commits into
masterfrom
doc/format-docstrings
Jul 9, 2026
Merged

doc: improve docstrings formatting#759
tgilon merged 14 commits into
masterfrom
doc/format-docstrings

Conversation

@tgilon

@tgilon tgilon commented Jun 19, 2026

Copy link
Copy Markdown
Member

Closes # (if applicable).

Changes proposed in this Pull Request

Follow up of #754. This PR improves the docstrings formatting following the approach introduced by PyPSA#2162. This PR also adds missing type hints.

Tasks

Workflow

Open issues

Notes

Generative AI was used to assist with code generation and review. All content has been reviewed, verified, and is the responsibility of the author.

Checklist

  • Security scan(s) show no high-severity bugs, critical vulnerabilities, or exposed secrets.
  • I tested my contribution locally and it works as intended.
  • Code and workflow changes are sufficiently documented.
  • Changed dependencies are added to pixi.toml (using pixi add <dependency-name>).
  • Changes in configuration options are added in config/config.default.yaml.
  • Changes in configuration options are documented in doc/configtables/*.csv.
  • Changes in configuration options are added in config/test/*.yaml.
  • The multiple weather/climate years test is passing locally (using pixi run -e open-tyndp tyndp-cyears-test).
  • Open-TYNDP SPDX license header added to all touched files.
  • For new data sources or versions, these instructions have been followed.
  • New rules are documented in the appropriate doc/*.rst files.
  • A release note doc/release_notes.rst is added.
  • Major features are documented with up-to-date information in doc/index.rst.
  • Module docstrings added to new Python scripts.

@tgilon tgilon added this to the Release v0.8 milestone Jun 19, 2026
@tgilon
tgilon requested a review from AndreasHD11 June 19, 2026 14:12
@tgilon tgilon self-assigned this Jun 19, 2026
@tgilon tgilon added SB Scenario Building CBA Cost Benefit Analysis labels Jun 19, 2026
Comment thread scripts/cba/solve_cba_network.py Outdated
Comment thread scripts/build_tyndp_network.py Outdated
Comment thread scripts/build_tyndp_network.py
Namespace containing spatial information for different carriers,
including nodes and locations
including nodes and locations.
options : dict

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are the options optional here like for tech cost assumptions? Some functions have "options : dict" whilst others have options : dict, optional (and then some lines on defaulting if the string is empty such as l4138 of prepare_sector_network.py). If so, small inconsistency with options in Parameters of fucntions.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The full stop is missing in theory, but this is the case for all the def add_generation() function, where none have full stops. Not sure if to fix this.

@tgilon tgilon Jul 1, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Are the options optional here like for tech cost assumptions?

It seems that we have been slightly inconsistent wrt to options. Some functions define the attribute as optional, other do not. Out of scope for this PR. The docstrings are consistent with the function attributes.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The full stop is missing in theory, but this is the case for all the def add_generation() function, where none have full stops. Not sure if to fix this.

I can't see any missing characters. The attribute types don't have a final full stop, but their definitions do.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I agree with the out of scope call. Do we need a follow-up issue for the options?

Comment thread scripts/prepare_sector_network.py
Comment thread scripts/sb/plot_offshore_network.py Outdated
@AndreasHD11

Copy link
Copy Markdown
Member

I can make the changes sometime this week if needed! @tgilon

@AndreasHD11
AndreasHD11 force-pushed the doc/format-docstrings branch from 69a59b3 to 05f0fe9 Compare June 29, 2026 13:55
@tgilon
tgilon requested a review from AndreasHD11 July 1, 2026 07:27
tgilon and others added 2 commits July 3, 2026 12:15
 Conflicts:
	envs/default_linux-64.pin.txt
	envs/default_osx-64.pin.txt
	envs/default_osx-arm64.pin.txt
	envs/default_win-64.pin.txt
	pixi.lock
Base automatically changed from merge-upstream-260617 to master July 6, 2026 12:55
@tgilon

tgilon commented Jul 6, 2026

Copy link
Copy Markdown
Member Author

@lisazeyen @daniel-rdt Could one of you two review this, as Andreas is unavailable?

@daniel-rdt
daniel-rdt requested a review from lisazeyen July 7, 2026 09:53

@lisazeyen lisazeyen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

thanks @tgilon ! LGTM!

@tgilon
tgilon requested review from AndreasHD11 and removed request for AndreasHD11 July 8, 2026 09:30
@tgilon
tgilon enabled auto-merge (squash) July 8, 2026 09:31
@tgilon
tgilon merged commit 6c66986 into master Jul 9, 2026
7 of 8 checks passed
@tgilon
tgilon deleted the doc/format-docstrings branch July 9, 2026 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CBA Cost Benefit Analysis SB Scenario Building

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants