Install the latest release from GitHub:
using Pkg
Pkg.add(url="https://github.com/Bittencourt/DESSEM2Julia.jl")Test your installation with the greet() function:
using DESSEM2Julia
DESSEM2Julia.greet()
# Output: "Hello World!"For additional installation options (development mode, local installation, etc.), see INSTALL.md.
Convert DESSEM input files (.DAT and related text files) into structured Julia objects and persist them in JLD2 format.
DESSEM is a hydrothermal dispatch optimization model used for short-term operational planning in Brazilian power systems.
🎉 PROJECT COMPLETE (December 20, 2025) - See Completion Summary
All 32 DESSEM parsers implemented • 7,680+ tests passing • Version 1.0.0
🗺️ Complete Documentation Index - Wiki-style navigation for all documentation
📖 Documentation Hub - Organized documentation overview
🗺️ Documentation Sitemap - Visual map of all docs
Quick Links:
- 🚀 Quick Start Guide - Get started in minutes
- 🔗 Entity Relationships - Complete ER model ⭐ ESSENTIAL
- 💧 HIDR Quick Reference - Hydro plant parsing
- 📋 File Formats - Parser status overview
Open this folder in VS Code, then in a Julia REPL run:
using Pkg
Pkg.activate(".")
Pkg.instantiate()
Pkg.test()- Repository structure:
docs/REPOSITORY_STRUCTURE.md- Complete guide to repo organization 📁
- Quick start guide:
docs/planning/QUICK_START_GUIDE.md⚡ START HERE - Complete project context:
docs/planning/PROJECT_CONTEXT.md📖 Essential reading - Tasks and roadmap:
docs/planning/TASKS.md - ONS compatibility summary:
docs/planning/ONS_COMPATIBILITY_SUMMARY.md
- Architecture overview:
docs/architecture.md - Type system guide:
docs/type_system.md⭐ - Entity relationships (Database-like model):
docs/ENTITY_RELATIONSHIPS.md🔗 NEW - DESSEM file format specifications:
docs/dessem-complete-specs.md - File coverage status:
docs/file_formats.md - Format implementation notes:
docs/FORMAT_NOTES.md
- OPERUT parser implementation:
docs/parsers/OPERUT_IMPLEMENTATION.md - IDESEM library comparison:
docs/parsers/idessem_comparison.md - Binary file formats:
docs/parsers/BINARY_FILES.md
- Session 5:
docs/sessions/session5_summary.md- Core type system implementation - Session 6:
docs/sessions/session6_summary.md- OPERUT parser implementation
-
Network visualization 📊 NEW!:
examples/visualize_network_topology.jl- Extract and visualize electrical network topology- Create electrical network diagrams (buses & transmission lines)
- Color-coded by subsystem (SE/S/NE/N)
- Edge thickness by power flow
- Network statistics and connectivity analysis
- See
examples/NETWORK_VISUALIZATION.mdfor complete guide
-
Transmission Analysis ⚡ NEW!:
examples/analyze_transmission.jl- Analyze network congestion and identify bottlenecks
- List critical aggregate constraints (Sum of Flows)
- Identify backbone transmission lines (highest flow)
-
Renewable Energy Analysis ☀️ NEW!:
examples/analyze_renewables.jl- Analyze wind and solar generation profiles
- Aggregate generation by subsystem
- Identify top renewable plants
-
Demand Analysis 📉 NEW!:
examples/analyze_demand.jl- Visualize system demand blocks
- Group demand by subsystem
- Show daily load profiles
-
Thermal Cost Ranking 💰 NEW!:
examples/rank_thermal_costs.jl- Rank thermal units by operating cost
- Identify cheapest and most expensive generation
-
Hydro Cascades 💧 NEW!:
examples/visualize_hydro_cascades.jl- Visualize hydro basins and upstream/downstream relationships
- Calculate total capacity per basin
-
Parse sample DESSEM case:
examples/parse_sample_case.jl- Comprehensive demonstration of parsing real CCEE data -
ONS compatibility check:
examples/verify_ons_compatibility.jl- Verify parser works with ONS network-enabled cases -
OPERUH parser test:
examples/test_operuh_parse.jl- Simple OPERUH parser demonstration
See examples/README.md for a complete list of examples.
The project includes two real-world DESSEM cases for testing:
- DS_CCEE_102025_SEMREDE_RV0D28: CCEE case without network constraints (October 2025)
- DS_ONS_102025_RV2D11: ONS case with network modeling enabled (October 2025, Rev 2)
Both samples are fully supported by the existing parsers. See docs/planning/ONS_COMPATIBILITY_SUMMARY.md for verification results.
Tests run in CI on pushes/PRs. To run tests locally before committing, enable the pre-commit hook:
PowerShell:
./scripts/setup-hooks.ps1Then commit as usual; the hook will run Pkg.test().
- Main module:
src/DESSEM2Julia.jl - Type definitions:
- Legacy types:
src/types.jl - Core type system:
src/models/core_types.jl⭐ (40+ types, 32/32 files complete - 100%)
- Legacy types:
- Parser infrastructure:
src/parser/(36 parser files, all DESSEM formats implemented)- Common utilities:
src/parser/common.jl - Registry system:
src/parser/registry.jl - All 32 DESSEM parsers complete ✅ (7,680+ tests passing)
- Master file index:
src/parser/dessemarq.jl✅ - Hydroelectric:
src/parser/hidr.jl,src/parser/hidr_binary.jl✅ (binary + text, 111 fields) - Thermal:
src/parser/termdat.jl,src/parser/operut.jl✅ - System config:
src/parser/entdados.jl✅ (35+ record types) - Network:
src/parser/desselet.jl,src/parser/network_topology.jl✅ - Constraints:
src/parser/operuh.jl,src/parser/restseg.jl,src/parser/rstlpp.jl✅ - See
docs/file_formats.mdfor complete parser list
- Common utilities:
- JLD2 I/O:
src/io.jl - Public API:
src/api.jl - Tests:
test/runtests.jl,test/*_tests.jl
We enforce consistent formatting in CI using JuliaFormatter. The CI lint job runs the formatter and fails if any diffs are produced.
- Config:
.JuliaFormatter.toml - Line endings:
.gitattributesenforces LF for.jl,.toml,.yml,.yaml,.jsonto avoid CRLF/LF drift - CI:
.github/workflows/ci.ymlincludes a "Lint (JuliaFormatter)" job that prints a unified diff when changes are needed
Run locally in a temporary environment (does not touch Project.toml):
julia --project=. scripts/format_ci.jlAlternatively (will add JuliaFormatter to your active environment):
julia -e "using Pkg; Pkg.add(;name=\"JuliaFormatter\", version=\"1\"); using JuliaFormatter; format(\".\", verbose=true)"Notes for Windows:
- The pre-commit hook may not run if
julia.exeisn’t on the expected path; if needed, commit with--no-verifyand run the formatter manually. - If you see CI lint failures, open the lint job logs; it now prints a unified diff to show exactly what to change.
- Comprehensive data model for all 32 DESSEM files
- 40+ types organized into 11 functional subsystems
- 15/32 files with complete type definitions (47% coverage)
- Hierarchical design:
DessemCase → Subsystems → Records - Full documentation in
docs/type_system.md
- Master file index parser (file registry/manifest)
- 68/68 tests passing (100%)
- Maps all 32 DESSEM input files dynamically
- Ordered
filesregistry exposes every entry asDessemFileRecordfor iteration
- Parses thermal plant registry (CADUSIT, CADUNIDT, CURVACOMB records)
- 110/110 tests passing (100%)
- Successfully parses 98 plants, 387 units from actual DESSEM files
- Parses general operational data (35+ record types - complete coverage)
- 2,362/2,362 tests passing (100%)
- Successfully parses all real CCEE and ONS data:
- Core data: 73 time periods, 5 subsystems, 168 hydro plants, 116 thermal plants, 293 demand records
- Network configuration: RD (network options), RIVAR (variable restrictions), REE (energy regions)
- Hydro modeling: TVIAG (water travel time), USIE (pump storage stations)
- Electrical constraints: RE (constraint definitions), LU (limits with optional fields)
- Plant adjustments: AC (variable format support), AG (aggregate groups)
- Coefficient records: FH, FT, FI, FE, FR, FC (hydro/thermal/interchange/energy/renewable/load)
- Advanced parameters: TX (discount rate), EZ (coupling %), R11 (gauge variations), FP (FPHA), SECR (river sections), CR (head-flow polynomials)
- Parses thermal unit operational data (INIT, OPER records)
- 62/62 tests passing (100%)
- Successfully parses real CCEE production data:
- 387 thermal units (47 ON, 340 OFF states)
- 422 operational constraint records
- Fixed-width column format based on IDESEM reference
- INIT records publish
initial_status(0=off, 1=on) for cross-parser consistency
- Parses natural inflow data and metadata
- 13/13 tests passing (100%)
- Successfully parses real CCEE data:
- Header metadata (plant roster, study start, FCF configuration)
- Daily inflow slices for 168 hydro plants
- Handles symbolic period markers ("I"/"F") and optional hours
- Parses hydro operational constraints (REST, ELEM, LIM, VAR records)
- All tests passing (100%)
- Successfully parses real ONS data:
- Constraint definitions (REST records)
- Plant participation factors (ELEM records)
- Time-varying operational limits (LIM records)
- Ramp/variation constraints (VAR records)
- Constraint ID linking validated
- Parses network case mapping (base cases + patamares)
- 15/15 tests passing (100%)
- Successfully parses real ONS data:
- Base network cases (4 PWF files: leve, media, pesada, etc.)
- Patamar scenarios (48 half-hourly time stages)
- Date/time scheduling with duration
- Base case reference linking
- Exception: Uses split() instead of fixed-width (variable spacing in actual files)
- Parses binary hydro plant registry (111 fields from IDESSEM specification)
- 54/54 tests passing (100%)
- Successfully parses 320 plants from ONS production data
- Complete field coverage:
- Basic identification (name, posto, subsystem, company)
- Storage limits (min/max/spillway/diversion volumes)
- Elevation data (min/max reservoir levels)
- Polynomials (volume-cota, cota-area curves - 10 coefficients)
- Evaporation (12 monthly values)
- Machine sets (up to 5 sets: capacity, head, flow)
- Performance (productivity, losses, tailrace polynomials - 36 coefficients)
- Operational parameters (15 fields: TEIF, IP, regulation type, etc.)
- Binary format: 792 bytes/plant (little-endian)
- Special handling: 8-byte posto_bdh field, 300-byte reserved block
- See
docs/sessions/session14_hidr_complete.mdfor details
- Parses renewable energy plant data and relationships (EOLICA, EOLICASUBM, EOLICABARRA, EOLICA-GERACAO records)
- 45/45 tests passing (100%)
- Successfully parses renewable plant types (wind, solar, biomass, small hydro):
- Plant registrations (code, name, pmax, fcap, cadastro)
- Subsystem mappings (market region relationships)
- Bus mappings (electrical network connections)
- Generation forecasts (time series availability data)
- Semicolon-delimited format (exception to DESSEM fixed-width standard)
- Handles multiple plant types: UEE (wind), UFV (solar), UTE (biomass), PCH/CGH (small hydro)
- Extracts electrical network topology from PDO output files
- 1,932/1,932 tests passing (100%)
- Successfully extracts from real ONS data:
- 342 buses with generation/load/voltage data
- 629 transmission lines with flow/capacity data
- Subsystem mapping (NE, SE, S, N)
- Connectivity analysis and graph metrics
- Visualization capabilities:
- Interactive network diagrams (buses & lines)
- Color-coded by subsystem
- Edge thickness by power flow magnitude
- Spring layout for natural clustering
- See
examples/NETWORK_VISUALIZATION.mdfor guide
- Extracts electrical network topology from PDO output files
- 1,932/1,932 tests passing (100%)
- Successfully extracts from real ONS data:
- 342 buses with generation/load/voltage data
- 629 transmission lines with flow/capacity data
- Subsystem mapping (NE, SE, S, N)
- Connectivity analysis and graph metrics
- Visualization capabilities:
- Interactive network diagrams (buses & lines)
- Color-coded by subsystem
- Edge thickness by power flow magnitude
- Spring layout for natural clustering
- See
examples/NETWORK_VISUALIZATION.mdfor guide
- Parses power reserve requirement files (critical for system reliability)
- 235/235 tests passing (100%) - Fixed from 59/80 after column position corrections
- Successfully parses real ONS data:
- Reserve pool definitions (RP records: area + time window + description)
- Minimum reserve limits (LM records: half-hourly MW requirements, typically 48 per day)
- Handles symbolic period markers ("I" for initial, "F" for final day)
- Half-hourly time series (0-23 hours, 0-1 half-hour indicator)
- Key lesson: Character-by-character position analysis essential for fixed-width formats
- Fixed-width column format based on real ONS data analysis:
- Pos 10-11: day (2 chars)
- Pos 13-14: hour (2 chars, space-padded)
- Pos 16: half-hour (1 char: 0 or 1)
- Pos 18-19: day_final (2 chars)
- Pos 26-35: limit value (F10.2)
- Parses operating point / schedule definitions
- 17/17 tests passing (100%)
- Successfully parses real CCEE and ONS data:
- Fixed-width format handling element types (TERM, HIDR, etc.)
- Parses start/end times (Day, Hour, Half-hour)
- Handles optional fields and variable spacing
- Validated against IDESEM column specifications
Status: 32/32 parsers implemented (100%) ✅ 🎉 Tests: 7,680+ tests passing ✅
PROJECT COMPLETE! All DESSEM file parsers are implemented:
- 26 production-ready parsers with full structured parsing
- 6 appropriate placeholder parsers for binary/proprietary formats
For detailed status, see:
- 📋 File Formats Overview - Authoritative status
- 🔍 Completeness Audit v3 - Detailed breakdown
Production Parsers (26):
- Core:
dessem.arq,termdat.dat,entdados.dat,operut.dat,dadvaz.dat,deflant.dat,operuh.dat,desselet.dat,hidr.dat - Constraints:
areacont.dat,respot.dat,respotele.dat,restseg.dat,rstlpp.dat,rmpflx.dat,rampas.dat - Renewables:
renovaveis.dat(Wind/Solar/Biomass) - Auxiliary:
cotasr11.dat,curvtviag.dat,dessopc.dat,ptoper.dat,rivar.dat - Placeholders:
bateria.dat,ilstri.dat,tolperd.dat,metas.dat
Binary/Proprietary Placeholders (6):
mlt.dat(binary FPHA),modif.dat- DECOMP integration files (placeholder/binary parsers):
infofcf.dec,mapcut.dec,cortes.dec- Binary placeholders- ✅
cortdeco.rv2/cortdeco.rv0- FCF cuts binary parser (51 tests ✅) mapcut.rv2/mapcut.rv0- Cut mapping (pending research)
Total Tests: 7,680+ tests passing ✅ 🎉
- Comprehensive unit tests for all 32 implemented parsers
- Integration tests with real CCEE and ONS data
- Network topology extraction and visualization tests
- Binary file parsing validation