Open power-system modelling · British Columbia

Hourly operations for a hydro-rich grid.

An open PyPSA model of British Columbia’s electricity system—network, demand, hydro, renewables and thermal generation.

Landing palette
Resolution8,760

Hourly snapshots

Weather year2021

ERA5 and BC load

FrameworkPyPSA

Economic dispatch

Version0.2.0

Python 3.11+

StatusActive development

Publications are in preparation. Contact the developer for full access and current features.

01
About the model

From planning portfolios to feasible hourly operation

The model asks whether a capacity portfolio can meet demand hour by hour while respecting transmission, renewable availability, thermal limits and stored-water dynamics.

Purpose

Operational dispatch

Build and assess a full-year PyPSA network: congestion, dispatch, spill, curtailment, prices and adequacy.

System context

Integrated modelling

Designed to receive long-term investment choices and demand trajectories from BC-Nexus, with spatial VRE inputs from RESource.

Boundary

Not a production grid model

A research model with imputed electrical parameters and ongoing baseline calibration. Results require scenario-specific validation.

Integrated framework

SPATIALRESourceCandidate VRE sites and hourly resource
PLANNINGBC-NexusCapacity mix and demand trajectory
OPERATIONSPyPSA-BCHourly dispatch and network feasibility
FEEDBACKThresholdsCapacity, storage and transmission signals
02
Getting started

Install, configure, prepare, build

Recommended environment. The repository is a PEP 621 project using a src/ layout. uv is the documented runner; dependencies include PyPSA, atlite, GeoPandas, pandas, xarray and plotting libraries.

1 · Create the environment

uv sync

2 · Review configuration

FileResponsibility
config/params.yamlScenario, snapshots, cutout resolution and stage parameters.
config/data.yamlInput, output and remote-data paths only.
config/base_network.yamlPower factor, frequency, line reactance and transformer assumptions.
config/coders.yamlCODERS API tables, schemas and aliases.

3 · Run staged preparation

uv run python -m workflow.scripts.prepare_base_network
uv run python -m workflow.scripts.prepare_assets
uv run python -m workflow.scripts.prepare_profiles

4 · Build the network

uv run python -m workflow.scripts.build_model
Runner status. workflow/run_pypsa_bc.py remains available as a legacy all-in-one path, but it hard-codes the 2021 load input and calls older preparation functions. Prefer the staged entry points while the workflow migration is completed.

Expected outputs

Prepared network tables are written under data/processed_data/network/; technology profiles under data/processed_data/; PyPSA component dictionaries under data/pypsa_data/; and the default assembled network to results/pypsa/prepared_net.nc.

03
Scope & formulation

What is represented

DimensionCurrent representation
ObjectivePyPSA economic dispatch / linear network optimization assembled by build_model.py.
TimeDefault: hourly, 1 Jan–31 Dec 2021; 8,760 snapshots. ERA5 cutout uses UTC bounds corresponding to Pacific time.
SpaceDetailed CODERS substation/line network prepared first; the build can aggregate BC assets to GADM level-2 regional districts and add external trade nodes.
SupplyReservoir and run-of-river hydro, wind, solar, thermal, cogeneration, optional nuclear expansion, imports and a feasibility/backstop supply.
DemandBC Hydro balancing-authority profile spatially disaggregated with CEEI residential and commercial/SMI weights.
ExpansionCommitted and candidate VRE/nuclear sites can be added; transmission is typically fixed unless explicitly overridden.
Unit commitmentDisabled by default (UC: false); thermal dispatch is therefore normally continuous rather than integer commitment.

Primary components

Bus

Electrical voltage nodes, aggregated regional buses, external trade nodes, fuel buses and water buses.

Line / transformer

AC transmission and voltage conversion from the prepared CODERS topology.

Generator / Link / Store

Electric generation, multi-port energy conversion and reservoir energy storage.

04
Network structure

CODERS topology, enriched for PyPSA

The reusable network package prepares lines, derives buses from line endpoints, and inserts transformers where a substation spans voltage levels. The build stage can remap component buses to administrative regions and collapse parallel inter-regional corridors.

INPUTCODERS linesNode codes, voltage, length, ratings
CLEANSanitize & repairAliases, missing WAX link, duplicates
ENRICHElectrical typesRatings, r/x/c, bus names
ASSEMBLEPyPSA networkLines, buses and transformers
ParameterCurrent ruleConfidence
Line capacityCODERS summer MVA where present; otherwise MW converted with configured power factor. The assumption log currently records ttc_summer as proxy.Verify
ReactanceVoltage-to-reactance lookup in base_network.yaml.Literature check
Resistance / conductorClosest ampacity match to the custom Chapter 13 line table.Imputed
Shunt capacitance8.85 nF/km.Assumed
TransformerGeneric 2,000 MVA type; 10% short-circuit voltage, 0.3% resistance and configured tap range.Placeholder
Interpretation limit. The base network is suitable for research screening, but missing nameplate impedance and transformer data mean voltage-specific electrical parameters are partly inferred. Do not treat corridor flows as utility-grade power-flow validation.
05
Hydro architecture

Water is routed explicitly through cascades

Reservoir hydro is represented with water buses, Stores and Links rather than a single PyPSA StorageUnit. This supports upstream/downstream cascade routing, turbine conversion, reservoir energy and spill.

ERA5 runoff / calibrated inflow
Generator on water bus
GSS water bus
inflow and routing junction
Downstream GSS
release / spill link
Reservoir Store
MWh-water, cyclic option
RES water bus
stored-water node
AC bus
turbine discharge link

Hydro data contract

Static physics—reservoir storage, discharge and cascade order—is separated from volatile CODERS fleet attributes. A versioned static inventory is joined to each CODERS release, then converted to the legacy cascade schema consumed by create_hydro_assets. GRanD/GDW and Water Use Plan data can replace frozen legacy values as they are verified.

Capacity convention. The legacy convention applies no derating; the optional live convention uses CODERS derates and was documented as reducing effective cascade capacity by roughly 7%. Record the chosen convention for every scenario.
06
Data & workflow

A reproducible path from sources to network

STAGE 1Base networkLines → buses → transformers
STAGE 2AssetsWind, solar, thermal and hydro
STAGE 3ProfilesERA5 VRE, RoR and reservoir inflows
STAGE 4Build modelLoad, components, trade and scenarios
SourceUseKey handling
CODERSGenerators, existing hydro, lines, substationsCentral alias/required-column layer in config/coders.yaml; local table cache.
ERA5 + atliteWind, solar, runoff and cutout0.25° default grid; 2021 weather year.
HydroBASINSCatchments and hydro routingNorth American and Arctic level-12 basin files.
GADMProvince and regional-district polygonsLevel 1 scope; level 2 spatial aggregation/disaggregation.
BC Hydro / CEEIHourly demand and sectoral spatial weightsProfile repair, normalization and annual-total scaling.
NRCan CWTD / Global Wind AtlasTurbine inventory, model crosswalk, siting checksPublic fetch plus turbine power-curve dictionary.
07
System schematics

How information and energy move

Model assembly

Static network
Bus · Line · Transformer
+
Asset dictionaries
Generator · Link · Store
+
Hourly profiles
Load · availability · inflow
Scenario controls
capacity · trade · EV
PyPSA Network
8,760 snapshots
Operational results
dispatch · flow · price · storage

Demand disaggregation

TEMPORALBC HydroProvincial hourly shape
SPATIALCEEI sectorsRegional electricity shares
SCALEScenario annual loadNormalize and multiply
OUTPUTRegional loadsHourly p_set by bus
08
Assumptions register

What must be known before interpreting results

AreaAssumption / defaultConsequence
TemporalSingle 2021 weather/load shape; hourly resolution.No inter-annual hydrology or climate variability unless rerun with another cutout.
Reservoir initial stateCurrent assumption log records e_initial = 0; cyclic storage may be enabled in built networks.Cold-start and cyclic conditions must be checked on the actual network file.
Hydro headDam height may proxy rated head; turbine efficiency converts volume to energy.Reservoir energy capacity inherits head uncertainty.
Transmission securityOlder model documentation cites an 85% loading/security threshold; verify whether s_max_pu is set in each built network.Do not assume N-1 security solely from nominal ratings.
Thermal operationsUnit commitment off; gas-grid flag off by default.No binary start/stop physics in the default run.
LoadRegional CEEI weights applied to a provincial hourly shape.Local temporal diversity is not independently observed.
BackstopFeasibility generation may be added.Any dispatch indicates unmet capacity or deliverability, not real generation.

The machine-maintained source of record is docs/ASSUMPTION_REPORT.md, populated through pypsa_bc.reporting.assumptions. Scenario runs should append assumptions rather than overwrite the register.

09
Validation & readiness

Use evidence, not polish, as the release gate

Research release disclaimer. This documentation describes a model that is still evolving. Related publications are under preparation, and some data, scenarios, calibration material, or advanced features may not be included in a public website release. Contact the model developer before relying on results or to request full model access and feature availability.
CapabilityStatusRequired check
Package/config splitImplementedConfirm all scripts now read migrated parameters from the correct YAML.
Base network preparationImplementedResolve CODERS transmission data gaps and validate imputed electrical values.
Hydro static/volatile pipelineImplementedIncrease independently verified reservoir inventory and record capacity convention.
2021 baselineTargetReproduce annual/monthly load, hydro generation, trade and observed operational ranges.
Threshold feedbackAdaptation neededRead spill from Links and state of charge from Stores, not StorageUnits.

Minimum run QA

Energy balance

Annual load, generation, imports/exports, losses and storage change reconcile.

Adequacy

Backstop dispatch is zero for a feasible baseline; investigate every non-zero hour.

Hydro

Seasonal storage, spill, inflow calibration and generation match credible ranges.

Network

Line loading, congestion duration and nodal prices are plausible and traceable.

VRE

Capacity factors, profiles, asset locations and curtailment are checked for anomalies.

Provenance

Input versions, scenario controls and modelling assumptions are recorded.

10
Learning resources

A reading path for users and contributors

11
Code map

Where to look when extending the model

AreaLocationResponsibility
Configurationsrc/pypsa_bc/attributes_parser.pySingle access point for the four YAML configuration files.
Networksrc/pypsa_bc/network/Bus, line and transformer sanitation, enrichment and tables.
Hydrologysrc/pypsa_bc/hydro.pyBasins, cutouts, inflows, calibration, RoR and cascade calculations.
Data clientssrc/pypsa_bc/data/CODERS, downloads, hydro inventory builders and adapters.
Reportingsrc/pypsa_bc/reporting/Logging, assumptions and data provenance.
Workflowworkflow/scripts/Preparation, formatting and network assembly entry points.
Visualizationsrc/pypsa_bc/vis/Plot helpers and the Dash results viewer.
Contributor rule. Reusable computation belongs in src/pypsa_bc; workflow modules should orchestrate configuration, package calls and outputs. Paths belong in data.yaml, physical assumptions in base_network.yaml, and run controls in params.yaml.