iiasa / iiasa/message_ix

Zero values in GDX

Open
#516 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
150
Forks
178
Avg merge
17h 32m
Merged PRs (30d)
2

Description

Due to efficiency considerations in GAMS for storing sparse data, zero values in GDX files are ignored by default when loading data of a model. It seems for overcoming this issue, there are some _mapping sets_ in `message_ix`, like `is_bound_emission` or `is_relation_upper`, to pass the information that cannot be loaded from GDX files, i.e., zero values in parameters when compiling a model. This workaround has a few drawbacks:
1. These mapping sets increase the number of model items and store some space even maybe small.
2. There needs to be instructions for users on how and where add these mapping sets, when the user aims to add new parameters to the model as requested in #514.
3. Not loading zero values in some of existing parameters without such mapping sets can be problematic as reported in #515. And defining such mapping sets for many parameters may not be desirable (see No. 1).
4. The issue of not displaying zero values in the output GDX file is not resolved by this workaround. This creates confusion for some postprocessing calculations, where zero values are different from missing values (e.g., prices). See #306 for example.

It seems GAMS has an option to convert zero values to Eps when loading from GDX and compiling a model (see [$OnEps and $OffEps](https://www.gams.com/35/docs/UG_DollarControlOptions.html#DOLLARonoffeps)). This can potentially resolve the issues 1-3 listed above, but not 4. Are there any other plans to tackle this in `ixmp` or GAMS?

Contributor guide

Open the contributing guide

Research direction

Review the existing mapping sets named in the issue, including is_bound_emission and is_relation_upper, and compare their behavior with GAMS $OnEps/$OffEps and the related issues #514, #515, and #306. Done should be a decided, documented approach for preserving the distinction between zero and missing values during loading and output.

Written by the indexing model from the issue text.

Assessment

Domain
data-engineering
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.