Implement 3-Layer GMPL → MUIO Conversion Pipeline (Parser, Interpreter, Transformer)#23
Open
parthdagia05 wants to merge 1 commit intoOSeMOSYS:masterfrom
Open
Implement 3-Layer GMPL → MUIO Conversion Pipeline (Parser, Interpreter, Transformer)#23parthdagia05 wants to merge 1 commit intoOSeMOSYS:masterfrom
parthdagia05 wants to merge 1 commit intoOSeMOSYS:masterfrom
Conversation
Implement 3-layer GMPL → MUIO conversion pipeline - Phase 1: GMPLParser (syntax extraction) - Phase 2: SliceInterpreter (semantic tuple expansion) - Phase 3: MuioTransformer (MUIO JSON generation) - Added validation scripts and fixtures - Fully testable, pure functional modules
dd3cd0b to
0b8d759
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes : #2
Feature: 3-Layer GMPL to MUIO JSON Transformation Pipeline ⚙️
Closes: #
Overview
This PR introduces a complete, modular, and fully validated 3-layer pipeline to convert standard GMPL/OSeMOSYS
.datfiles into MUIO-compatible JSON structures.The implementation is designed as a standalone, additive conversion engine. It does not modify existing application behavior and requires no external dependencies, making it a safe and testable foundation for future UI import workflows.
Architecture
The pipeline follows a strictly decoupled 3-phase execution model to ensure structural integrity and semantic accuracy.
Data Flow:
GMPL .dat➔ GMPLParser (Syntax) ➔ SliceInterpreter (Semantics) ➔ MuioTransformer (Schema) ➔MUIO JSONPhase Details
1. GMPLParser (Structural Extraction)
File:
GMPLParser.pyResponsible for parsing raw GMPL syntax into structured Python objects without altering data semantics.
999:=), headerless parameters, mixed whitespace (tabs/spaces), and trailing decimals (0.).2. SliceInterpreter (Semantic Expansion)
File:
SliceInterpreter.pyExpands parsed slice blocks into normalized tuple dictionaries:
{ param_name: { dimension_tuple: value } }.*), single/double wildcard resolution, and region padding.3. MuioTransformer (MUIO JSON Generation)
File:
MuioTransformer.pyTransforms normalized tuples into the exact JSON schema required by the MUIO backend.
FUEL➔COMMODITYand injects required MUIO sets (e.g.,UDC,STORAGEINTRADAY).SC_0).T_0,T_1C_0,C_1E_0,E_1Validation Suite
Comprehensive tests have been implemented to ensure zero regressions across the pipeline. These can be executed locally via: