Support autogeneration of RES data/diagram
- 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
Assessment
This issue has not been assessed yet.