Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
12b25ea
Updated to use v4 schema and include the representative periods proce…
david-turnbull Jul 13, 2026
f63b868
Added updated README
david-turnbull Jul 13, 2026
71b8740
Add files via upload
david-turnbull Aug 4, 2026
81e3cb2
Add files via upload
david-turnbull Aug 6, 2026
6a05b29
Add files via upload
david-turnbull Aug 6, 2026
db4ddbc
Correction to output schema
david-turnbull Aug 6, 2026
2bd3640
Update tsam version to 3.4.2 in requirements.txt
david-turnbull Aug 6, 2026
fe31ed8
fix dsd processing when flatline is used
yamilbknsu Aug 6, 2026
2f5475e
Merge pull request #7 from CANOE-main/yep/v4_fix
david-turnbull Aug 6, 2026
2ee7660
Fix percentile threshold for DSD normalisation
idelder Aug 11, 2026
e180e7f
Merge pull request #8 from CANOE-main/ide/fix/dsd_thresh
idelder Aug 11, 2026
aaae9b7
Add files via upload
david-turnbull Aug 13, 2026
c776467
Add files via upload
david-turnbull Aug 13, 2026
55539cb
Updated file to fix data insertion issue
david-turnbull Aug 13, 2026
63d0b69
Fix filtering process
david-turnbull Aug 13, 2026
004a4e9
Fixing filtering bug part 2
david-turnbull Aug 13, 2026
d51beb7
Updating the code for making into executable
david-turnbull Aug 14, 2026
6c98caf
Updated to include pca control into the app interface
david-turnbull Aug 17, 2026
692ba2b
Updated functionality of interface, repairing bugs
david-turnbull Aug 24, 2026
6d43d6f
Updated functionality of interface, repairing bugs
david-turnbull Aug 24, 2026
851e035
Add files via upload
david-turnbull Aug 24, 2026
ac64b66
Add files via upload
david-turnbull Aug 24, 2026
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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@
*.log
*.pyc
build/
dist/
dist/
__pycache__/
venv/
28 changes: 26 additions & 2 deletions CANOE.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,33 @@
import sys
from PyInstaller.utils.hooks import collect_all

datas = [('assets', 'assets')]
datas = [
('assets', 'assets'),

# Representative Periods configuration
(
'representative_periods/config.yaml',
'representative_periods'
),

# SQL schemas used by Representative Periods
(
'representative_periods/canoe_schema_v3_1.sql',
'representative_periods'
),
(
'representative_periods/canoe_schema_v4_0.sql',
'representative_periods'
),

# Time-series input data
(
'representative_periods/timeseries',
'representative_periods/timeseries'
),
]
binaries = []
hiddenimports = []
hiddenimports = ['matplotlib.backends.backend_pdf']
tmp_ret = collect_all('flet')
datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2]
tmp_ret = collect_all('flet_core')
Expand Down
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ The app provides a simple graphical interface (built with [Flet](https://flet.de
## Features

- **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, and assets are stored in appropriate locations for Python and compiled builds.
- **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.sql` file used for SQLite setup.
- **Config persistence:** saves UI options and state to a JSON configuration file.

Expand All @@ -26,6 +27,7 @@ The app provides a simple graphical interface (built with [Flet](https://flet.de
├── 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)
Expand Down Expand Up @@ -80,11 +82,20 @@ Configuration files will be created in:

## Using the App

When the window opens:
- **Select model directories or inputs** — depending on the UI options available in your version of the interface.
When the window opens, you will have access to two main tabs:

### 1. Aggregation Tab
- **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.
- **Click submit to process** — The input dataset will be processed into the output database
- **View logs** in the terminal or in the `logs/` folder.
- **Submit** — runs the aggregation pipeline to generate a standard database.

### 2. Representative Periods Tab
- **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`):

Expand Down
Loading
Loading