A desktop application for managing and processing CANOE energy model databases and configurations.
The app provides a simple graphical interface (built with Flet) to select model inputs, manage SQL schemas, and process datasets for the CANOE energy systems model.
Please check the release section for an executable file of the interface, downloading them means you don't need to clone the repositorys
- Cross-platform UI: built with Flet (runs as a Python script or compiled Windows executable).
- Unified Pipeline: process database aggregation and representative period clustering (via TSAM) in one tool.
- Automatic logging: every session writes a timestamped log file for debugging and tracking.
- Platform-aware directories: logs, config, plots, and assets are stored in appropriate locations for Python and compiled builds.
- Database schema support: automatically loads a bundled
schema.sqlfile used for SQLite setup. - Config persistence: saves UI options and state to a JSON configuration file.
.
├── main.py # Entry point for the Flet application
├── database_processing.py # Database processing utilities
├── directories.py # Manages platform-specific paths
├── log_setup.py # Global logging configuration
├── constants.py # Shared enums and constants
├── requirements.txt # Python dependencies
├── representative_periods/# TSAM clustering scripts and logic
├── assets/
│ └── schema.sql # SQL schema used by the database
├── logs/ # Log output (created automatically)
├── input/
│ └── config.json # Saved UI configuration
# Create an empty environment (no dependencies yet)
python -m venv .venv
# Activate it
# Windows:
.venv\Scripts\activate
# macOS/Linux:
source .venv/bin/activatepip install -r requirements.txtInside the representative_periods folder, there is a file called timeseriesaggregation.py, copy it and paste into venv\Lib\site-packages\tsam. If you don't do this then the representative periods section will not work.
Once dependencies are installed, launch the app with:
python main.pyLogs will be written to:
./logs/
Configuration files will be created in:
./input/config.json
When the window opens, you will have access to two main tabs:
- Select model inputs and outputs — provide the paths for your input dataset and desired output CANOE database.
- Select region-sector-scenario configurations — determines the resolution of the output CANOE model.
- Submit — runs the aggregation pipeline to generate a standard database.
- Configure Clustering — define your target Test Periods, Final Periods, Clustering Method (e.g., hierarchical, k_means), and Days per Period.
- Initialize (Cluster Only) — executes just the TSAM clustering scripts.
- Run (Aggregate & Cluster) — runs an end-to-end pipeline: aggregation -> clustering -> final output database processing.
- Output Console — streams all script output (stdout/stderr) so you can watch clustering progress in real-time.
Note: Any generated plots (duration curves, timeseries) will be saved directly to the clustering_plots directory in your appdata folder.
If you’re running a compiled executable, logs and config are stored in your user directories (via platformdirs):
C:\Users\<you>\AppData\Local\CANOE\RSSSelector\Logs
C:\Users\<you>\AppData\Local\CANOE\RSSSelector\Config
You can build a standalone Windows executable using PyInstaller.
pip install pyinstallerpyinstaller CANOE.specOnce built, your app will appear in the dist/ folder:
dist/
└── main.exe
When you run the EXE:
platformdirsensures logs and configs are written under your user’s app data folder.- Bundled resources (like
schema.sql) are available throughdirectories.get_resource_path().
Every run of the app generates a timestamped rotating log file, such as:
logs/canoe_app_2025-11-10_15-30-42.log
Logs include timestamps, log levels, and message origins. When running as a compiled EXE, logs are written under:
%LOCALAPPDATA%\CANOE\RSSSelector\Logs
Common definitions for regions, sectors, and model parameters are located in constants.py.
This includes:
- Enumerations for model regions, sectors, and variants.
- UI scenario defaults.
- Table lists and default parameter values for CANOE datasets.