Skip to content

Design

Design Principles

Convexity uses a unified database design that stores all component types (buses, generators, loads, lines, links, storage units, stores) in a single components table, and all their attributes (both static and time series) in a single component_attributes table. This elegant design simplifies operations while maintaining full PyPSA compatibility.

Key features:

  • Single components table: All component types share one table with a component_type field
  • Unified attributes: Both static values and time series data stored in one table
  • Scenario support: Sparse override system where scenarios only store differences from base network
  • Binary time series: Efficient storage using raw f32 arrays
  • Database-enforced validation: 167+ PyPSA attributes with validation rules and triggers

Entity Relationship Diagram

The diagram below shows all tables in the Convexity database and their relationships:

Convexity Database SchemaConvexity Database Schema

The diagram illustrates the core structure of the database, starting with network_metadata which defines the network and time axis, and carriers which categorize energy types. The components table serves as the unified storage for all component types (buses, generators, loads, lines, links, storage units, stores), with each component's properties stored in the component_attributes table that handles both static values and time series data. The scenarios table enables what-if analysis through sparse overrides that only store differences from the base network, while attribute_validation_rules enforces PyPSA compatibility with 167+ validated attributes. Finally, network_solve_results stores optimisation outcomes for each scenario, completing the data flow from model definition through to solution.

© Copyright 2025 Bayesian Energy