iiasa / iiasa/message_ix

Support autogeneration of RES data/diagram

Open
#580 7 comments 1 reaction 2 assignees Claimed by @macflo8 View on GitHub
discuss enh help wanted
Dominant language
Jupyter Notebook
Stars
150
Forks
178
Avg merge
17h 32m
Merged PRs (30d)
2

Description

# Request

In many contexts, understanding the underlying reference energy system (RES) structure of a given scenario is needed.

Given the RES structure in a dataframe, we can then use this directly and generate visuals to support debugging and other concerns.

# Example

Generally, this can be done by intelligently interrogating `input` and `output` parameters for a scenario.

Below is an example of two functions that could help

```
def find_inp_link(s, tec, filters):
filters = filters.copy()
filters['technology'] = tec
df = s.par('input', filters=filters)
df = df[['commodity', 'level']].drop_duplicates()
return df

def find_outp_link(s, inp_link, filters):
filters = filters.copy()
filters = dict(**filters, **inp_link)
df = s.par('output', filters=filters)
df = df[['technology']].drop_duplicates()
return df
```

Consider the example of `LNG_exp` in current versions of the global model

```
filters = {'node_loc': 'R15_NAM', 'year_act': 2020}
tec = 'LNG_exp'
inp_link = find_inp_link(s, tec, filters).iloc[0].to_dict()
>>> {'commodity': 'LNG', 'level': 'primary'}
```
then
```
find_outp_link(s1, inp_link, filters).iloc[0].to_dict()
>>> {'technology': 'LNG_prod'}
```
and so on

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.