C2070 Delta E+Delta E+ · SFU

API

Code and API

The C2070 codebase is open. This page shows how to get it, set it up and run the model from the command line. For what each module does, see the Code map in Model.

Get the codeThe full repository on GitHub: model, data pipeline, notebooks and this site.Open GitHub →InstallOne reproducible uv environment; the default solver ships as a wheel.Show →Run the modelSeven commands from model structure to an HTML report.Show →Command line13 commands behind uv run osecan.Show →Code mapWhat each module does and which layer it belongs to.Open in Model →Developer guidesNaming rules, adding a policy type, data staging and solver diagnostics.Show →
Install

C2070 (package osecan) is a uv project. uv installs Python and the pinned dependencies from pyproject.toml and uv.lock.

git clone https://github.com/eliasinul/CLEWsCAN2070.git
cd CLEWsCAN2070
uv sync            # creates .venv from pyproject.toml + uv.lock
Run the model
uv run osecan build-sets                       # structure -> SETs/
uv run osecan build-params                     # placeholder parameters (+ WS3/FABLE seams)
uv run osecan retrieve                         # open datasets -> data/external (+ sha256)
uv run osecan clean-demand "Current Measures"  # CER EF2026 -> SpecifiedAnnualDemand
uv run osecan harmonize                        # gate: parameters reference only built set codes
uv run osecan solve --run results/base         # preprocess -> solve -> result CSVs
uv run osecan report                           # HTML dashboard (+ transmission map)

osecan solve uses GLPK through Python bindings and needs no system solver. osecan run is the subprocess variant and needs glpsol on the PATH. Notebooks: uv run jupyter lab, then open notebooks/build_osecan.ipynb.

Command line
CommandDoes
osecan build-paramsGenerate placeholder parameters for the current model sets.
osecan build-setsGenerate OSeMOSYS sets and activity-ratio CSV files.
osecan clean-capacityConvert observed CER capacity to residual capacity and annual bounds.
osecan clean-demandConvert CER end-use demand to SpecifiedAnnualDemand parameters.
osecan harmonizeCheck that parameter CSVs reference valid generated codes and years.
osecan infoPrint the model name, horizon, provinces, and land/water scope."""
osecan mapGenerate a transmission map using capacity or solved flows.
osecan profilePrint a dataset's schema and categorical values before cleaning.
osecan reportGenerate the interactive HTML report for model inputs and outputs.
osecan retrieveDownload configured open datasets and record SHA-256 provenance.
osecan runAssemble inputs, solve the model, and extract results with diagnostics.
osecan siteGenerate the project website from the live codebase and documentation.
osecan solveSolve a prepared run with GLPK bindings and extract result CSVs.
Developer guides
  • Model description: design decisions, naming convention, set generation, and how to declare, add and test a User Defined Constraint.
  • Data pipeline: retrieve, clean and map, harmonise, and source provenance.
  • Solve and diagnostics: solver stages, the diagnostics bundle and debugging infeasibility.