Skip to content
Back to skills

Network Modeling

ASecurity

Build, mutate, validate, and migrate PyPSA Network component models.

  • 247 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added September 9, 2026
dataapi

Works with

  • api

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill network-modeling --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Network Modeling?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Network Modeling
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-network-modeling/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-network-modeling)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: network-modeling
description: "Build, mutate, validate, and migrate PyPSA Network component models."
disable-model-invocation: true
metadata:
  disco-role: operating
license: MIT
---

# PyPSA network-modeling sub-skill

Use this sub-skill when the task is to create or mutate a `pypsa.Network`: define buses, carriers, components, static and time-varying attributes, snapshots, investment periods, scenarios, component schemas, standard line/transformer types, and modeling-related options or consistency checks.

## Route here

- Build a network from scratch with `pypsa.Network()` and `n.add(...)`/`n.remove(...)`.
- Inspect or edit component tables through `n.components`, `n.c`, `n.generators`, `n.generators_t`, or the new Components API.
- Decide whether attributes are static, time-varying, scenario-specific, or period-specific.
- Define carriers, buses, generators, loads, lines, links, stores, storage units, transformers, standard types, and global constraints as model inputs.
- Run `n.consistency_check()`, `n.sanitize()`, `n.calculate_dependent_values()`, `n.copy()`, or `n.equals(...)` to validate the model structure before solving.

## Route away

- Import/export, CSV/netCDF/HDF5/Excel/cloud paths, and example-network caching belong to [network-io-data](../network-io-data/SKILL.md).
- `n.optimize(...)`, Linopy models, solver choices, linear/nonlinear power flow, and infeasibility tracing belong to [optimization-powerflow](../optimization-powerflow/SKILL.md).
- Statistics, plotting, clustering, maps, charts, and `NetworkCollection` analysis belong to [analysis-visualization](../analysis-visualization/SKILL.md).

## Operating loop

1. Create the network and define snapshots before adding time-varying data.
2. Add explicit `Carrier` rows for every bus carrier and technology carrier to avoid undefined-carrier warnings.
3. Add `Bus` rows before components that reference them; use `Link` for controllable cross-carrier conversion and `Line`/`Transformer` for passive electric branches.
4. For multiple components with time-varying data, pass a `DataFrame` whose index is exactly `n.snapshots` and whose columns are exactly the component names.
5. Validate with `n.consistency_check(...)`; use `n.sanitize()` only when adding missing buses/carriers and deterministic carrier colors is acceptable.
6. Route to optimization or analysis only after the network structure and time-series shapes are clean.

## Runtime references and helper

- [API reference](references/api-reference.md) explains verified constructor/mutation signatures, Components-store access, old/new API migration points, and static-vs-dynamic shape rules.
- [Component patterns](references/component-patterns.md) gives self-contained recipes for buses, carriers, one-port components, branches, storage, sector coupling, standard types, periods, and scenarios.
- [Options and consistency](references/options-and-consistency.md) covers modeling-relevant PyPSA options, scoped `option_context` use, consistency checks, `sanitize`, and stochastic/multi-period validation.
- [Troubleshooting](references/troubleshooting.md) maps common modeling warnings and errors to concrete fixes, including DataFrame shape mismatches and Components API deprecations.
- [Build tiny network helper](scripts/build_tiny_network.py) creates a deterministic self-contained network with carrier rows, optional time series, optional new Components API access, and optional consistency checks.

Files in this skill

  • SKILL.md3.4 KB
  • references/api-reference.md10.3 KB
  • references/component-patterns.md11 KB
  • references/options-and-consistency.md9 KB
  • references/troubleshooting.md9.8 KB
  • scripts/build_tiny_network.py6.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.