An interactive web application for exploring and visualizing TIMES energy model results stored in DuckDB databases.
Assuming you are in streamlit-app/
First Time Setup:
# Double-click this file:
launch_app.batThis will automatically:
- ✅ Create a virtual environment
- ✅ Install all dependencies
- ✅ Launch the app in your browser
Subsequent Launches:
# Use the faster simple launcher:
launch_app_simple.batSetup (first time only):
# Install dependencies
pip install -r requirements.txtLaunch:
# Run Streamlit
streamlit run main.pyThe app will automatically open in your browser at http://localhost:8501
- Python 3.8 or higher
- Internet connection (for connecting to database from Azure URL)
- Modern web browser (Chrome, Firefox, Edge, Safari)
Check these files in the inputs/ folder:
| File | Purpose |
|---|---|
mapping_db_views.csv |
Defines how database tables are queried and labeled |
unit_conversions.csv |
Defines unit conversion rules (e.g., kt → t, PJ → GJ) |
| File | Purpose |
|---|---|
config/default_units.yaml |
Default target units for each category (mass, energy, currency) |
config/module_registry.py |
Where the existing modules are registered and set to active or inactive |
modules/subannual/config/profile_config.yaml |
Subannual module visualization settings |
modules/energy_map/config/map_settings.yaml |
Map module display settings (zoom, colors, line styles) |
modules/energy_map/config/region_coordinates.yaml |
Geographic coordinates for regional mapping |
Configure in the sidebar when you launch the app:
-
Connection Type:
- Azure URL (default): Connect to cloud-hosted database
- Local File: Use a database file on your computer
-
Database Source:
- Azure URL:
https://speedlocal.flowcore.app/api/duckdb/share/... - Local path:
inputs/your_database.duckdb
- Azure URL:
-
Mapping CSV Path:
- Default:
inputs/mapping_db_views.csv
- Default:
Purpose: Executive dashboard with high-level project information
Purpose: Annual energy and emissions reporting
Features:
-
Energy Input Analysis:
- Aggregate view across all sectors
- Disaggregated view per sector
- Stacked bar charts by fuel type (comgroup)
-
Emissions Analysis:
- Aggregate emissions by sector
- Disaggregated emissions by commodity
- Line charts showing trends
Purpose: Visualize regional energy flows on interactive maps
Features:
- Interactive Folium maps
- Bidirectional flow visualization
- Animated flow paths (AntPath)
- Regional markers with NUTS coding
- Flow aggregation by fuel type
Purpose: analysis with subannual temporal resolution
Features:
- Stacked bar charts by specified group (techgroup, prc, com, comgroup, etc)
- timeslice group selector (ex. filter by weeks)
- Production visualization (price, consumption, and storage coming soon)
Purpose: Debugging and testing tools for developers, Troubleshoot data issues and explore database structure
Features:
- Filter debugging information
- Description table viewer
- Data inspector with column analysis
- Profile mapping generator (for configuration)
The app supports automatic unit conversion for multiple categories:
| Category | Example Units | Default |
|---|---|---|
| Energy | PJ, GJ, TJ, MWh | GJ |
| Mass | kt, t, Mt | t |
| Currency | MKr25, Kr25 | MKr25 |
| Length | km, m | km |
| Area | KHA, ha | KHA |
| Volume | MM3, m³ | MM3 |
Note: Rows with unknown or unconvertible units are filtered out. Check the exclusion summary to see what was removed.
Problem: "streamlit is not recognized as a command" Solution:
- Delete the
venvfolder - Run
launch_app.batagain - Or manually:
pip install -r requirements.txt
Problem: Database connection failed or tables are empty Solution:
- Check the Azure URL hasn't expired
- Verify
mapping_db_views.csvexists ininputs/ - Click "🔄 Reload Data" in the sidebar
Problem: All data disappears after enabling unit conversion Solution:
- Check if your data has the correct
unitandcurcolumns - Review the exclusion summary to see what was filtered out
- Verify
unit_conversions.csvhas the necessary conversion rules
Problem: Map is blank or regions not found Solution:
- Check
region_coordinates.yamlhas coordinates for your regions, maybe some regions are not automatically read and have to be hardcoded - Verify the needed table exists in your database
- Architecture Diagrams: See
documentation/architecture_simple.pngandarchitecture_full.png - Developer Documentation: See
README_DEVELOPER.md - TIMES Model Documentation: IEA-ETSAP
- TIMES Report Documentation: TIMESreport Documentation
-
Always check unit conversion exclusions to understand what data is being filtered
-
The Development module is useful for understanding data structure of queried tables through
mapping_db_views.csv -
Azure URLs expire - download the database locally if you need offline access