Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions data_files/my_configs/config_sample.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ source_trace = true
# Produce HTML files for Commodity Networks. Requires source_trace above
plot_commodity_network = true

# Check units consistency in the database
# Validates that units are properly formatted and consistent across related tables
# Recommended for production runs after units are populated in the database
check_units = false

# ------------------------------------
# SOLVER
# Solver Selection
Expand Down
17 changes: 16 additions & 1 deletion data_files/temoa_schema_v4.sql
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ CREATE TABLE IF NOT EXISTS capacity_to_activity
tech TEXT
REFERENCES technology (tech),
c2a REAL,
units TEXT,
notes TEXT,
PRIMARY KEY (region, tech)
);
Expand All @@ -112,7 +113,8 @@ CREATE TABLE IF NOT EXISTS commodity
PRIMARY KEY,
flag TEXT
REFERENCES commodity_type (label),
description TEXT
description TEXT,
units TEXT
);
CREATE TABLE IF NOT EXISTS commodity_type
(
Expand Down Expand Up @@ -256,6 +258,7 @@ CREATE TABLE IF NOT EXISTS efficiency
output_comm TEXT
REFERENCES commodity (name),
efficiency REAL,
units TEXT,
notes TEXT,
PRIMARY KEY (region, input_comm, tech, vintage, output_comm),
CHECK (efficiency > 0)
Expand Down Expand Up @@ -354,6 +357,7 @@ CREATE TABLE IF NOT EXISTS loan_lifetime_process
vintage INTEGER
REFERENCES time_period (period),
lifetime REAL,
units TEXT,
notes TEXT,
PRIMARY KEY (region, tech, vintage)
);
Expand All @@ -376,6 +380,7 @@ CREATE TABLE IF NOT EXISTS lifetime_process
vintage INTEGER
REFERENCES time_period (period),
lifetime REAL,
units TEXT,
notes TEXT,
PRIMARY KEY (region, tech, vintage)
);
Expand All @@ -385,6 +390,7 @@ CREATE TABLE IF NOT EXISTS lifetime_tech
tech TEXT
REFERENCES technology (tech),
lifetime REAL,
units TEXT,
notes TEXT,
PRIMARY KEY (region, tech)
);
Expand Down Expand Up @@ -714,6 +720,7 @@ CREATE TABLE IF NOT EXISTS output_curtailment
output_comm TEXT
REFERENCES commodity (name),
curtailment REAL,
units TEXT,
PRIMARY KEY (region, scenario, period, season, tod, input_comm, tech, vintage, output_comm)
);
CREATE TABLE IF NOT EXISTS output_net_capacity
Expand All @@ -729,6 +736,7 @@ CREATE TABLE IF NOT EXISTS output_net_capacity
vintage INTEGER
REFERENCES time_period (period),
capacity REAL,
units TEXT,
PRIMARY KEY (region, scenario, period, tech, vintage)
);
CREATE TABLE IF NOT EXISTS output_built_capacity
Expand All @@ -742,6 +750,7 @@ CREATE TABLE IF NOT EXISTS output_built_capacity
vintage INTEGER
REFERENCES time_period (period),
capacity REAL,
units TEXT,
PRIMARY KEY (region, scenario, tech, vintage)
);
CREATE TABLE IF NOT EXISTS output_retired_capacity
Expand All @@ -758,6 +767,7 @@ CREATE TABLE IF NOT EXISTS output_retired_capacity
REFERENCES time_period (period),
cap_eol REAL,
cap_early REAL,
units TEXT,
PRIMARY KEY (region, scenario, period, tech, vintage)
);
CREATE TABLE IF NOT EXISTS output_flow_in
Expand All @@ -781,6 +791,7 @@ CREATE TABLE IF NOT EXISTS output_flow_in
output_comm TEXT
REFERENCES commodity (name),
flow REAL,
units TEXT,
PRIMARY KEY (region, scenario, period, season, tod, input_comm, tech, vintage, output_comm)
);
CREATE TABLE IF NOT EXISTS output_flow_out
Expand All @@ -804,6 +815,7 @@ CREATE TABLE IF NOT EXISTS output_flow_out
output_comm TEXT
REFERENCES commodity (name),
flow REAL,
units TEXT,
PRIMARY KEY (region, scenario, period, season, tod, input_comm, tech, vintage, output_comm)
);
CREATE TABLE IF NOT EXISTS output_storage_level
Expand All @@ -823,6 +835,7 @@ CREATE TABLE IF NOT EXISTS output_storage_level
vintage INTEGER
REFERENCES time_period (period),
level REAL,
units TEXT,
PRIMARY KEY (scenario, region, period, season, tod, tech, vintage)
);
CREATE TABLE IF NOT EXISTS planning_reserve_margin
Expand Down Expand Up @@ -994,6 +1007,7 @@ CREATE TABLE IF NOT EXISTS output_emission
vintage INTEGER
REFERENCES time_period (period),
emission REAL,
units TEXT,
PRIMARY KEY (region, scenario, period, emis_comm, tech, vintage)
);
CREATE TABLE IF NOT EXISTS rps_requirement
Expand Down Expand Up @@ -1049,6 +1063,7 @@ CREATE TABLE IF NOT EXISTS output_cost
fixed REAL,
var REAL,
emiss REAL,
units TEXT,
PRIMARY KEY (scenario, region, period, tech, vintage),
FOREIGN KEY (vintage) REFERENCES time_period (period),
FOREIGN KEY (tech) REFERENCES technology (tech)
Expand Down
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ Temoa Project Documentation
.. toctree::

Documentation
unit_checking
Loading