Skip to content

docs(examples): a link's or a process's output port reads its owner and its bus from one relation - #892

Open
FabianHofmann wants to merge 2 commits into
mainfrom
docs/output-connects
Open

FabianHofmann wants to merge 2 commits into
mainfrom
docs/output-connects

Conversation

@FabianHofmann

Copy link
Copy Markdown
Contributor

Prompt: "3" (the user picked: "Start (G2) as a PR that grows link_output into this form.")

Note

The following content was generated by AI.

Each link output port and each process port reads its owner and its bus from one relation with two value columns. Link_output_connects and Process_output_connects replace four relations, and every call names the column it reads.

Method, gate output, alternatives

Change. Link_output_link + Link_output_bus become Link_output_connects: {key: link_output, values: [link, bus]}. Process_output_process + Process_output_bus become Process_output_connects: {key: process_output, values: [process, bus]}. The at(..., by=X_connects[link]) and sum(..., by=X_connects[bus]) calls read one column each, so the model does not change. Files: examples/pypsa.yaml, examples/pypsa/{link,process}.yaml, tests/fixtures/pypsa_standard_shape.yaml, and the generated docs/examples/pypsa.md, docs/examples/pypsa/{link,process}.md (regenerated with pixi run python -m tools.gallery). No other file in src, tests, docs, tools or examples names the old relations.

Data contract. The data for each relation is now one table [link_output, link, bus] (or [process_output, process, bus]), not two. missing: stays the default, as for the old pair: every output port has a row.

Gates. pixi run lint passes. pixi run ci passes on 7cc95157: 2916 passed, 1 skipped; docs build has no issues; 54 TeX documents compile.

Not done, on purpose.

  • Link bus0 stays a separate relation. It is not folded into the output ports.
  • The component classes keep their own dimensions. No single component dimension.
  • No integer port dimension.

These are open design choices. A sketch of the enumerated-connection pattern for all components exists outside the tree.

…nd its bus from one relation

Link_output_link and Link_output_bus fold into Link_output_connects, keyed by
link_output with the values [link, bus]. Process_output_process and
Process_output_bus fold into Process_output_connects in the same way. Each
call names the column it reads, so the at() and sum() calls keep their
meaning.
@read-the-docs-community

read-the-docs-community Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 mathspec | 🛠️ Build #35193278 | 📁 Comparing 30365b9 against latest (7cc9515)

  🔍 Preview build  

3 files changed
± changelog/index.html
± examples/pypsa/link/index.html
± examples/pypsa/process/index.html

@brynpickering brynpickering left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is blocked by PyPSA/PyPSA#2015

This branch has not been deployed

No deployments
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.

2 participants