Skip to content

Commit

Permalink
Improving docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathias157 committed Oct 20, 2024
1 parent 220d2f0 commit d5c7c6d
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/examples/execution.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Execution

The 'Balmorel' class can also be used to run Balmorel scenarios.
The 'Balmorel' class can also be used to run Balmorel scenarios. Check out [this notebook](https://github.com/Mathias157/pybalmorel/blob/master/examples/Execution.ipynb) or the examples below.

```python
from pybalmorel import Balmorel
Expand Down
43 changes: 42 additions & 1 deletion docs/examples/postprocessing.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,44 @@
# Post-Processing

There are several functions to plot energy balances, transmission capacity maps and a ipywidget to interactively plot bar charts, check out [this notebook](https://github.com/Mathias157/pybalmorel/blob/master/examples/PostProcessing.ipynb).
There are several functions to plot energy balances, transmission capacity maps and a ipywidget to interactively plot bar charts, check out [this notebook](https://github.com/Mathias157/pybalmorel/blob/master/examples/PostProcessing.ipynb).

The example below uses the Balmorel class to load results.

## Interactively Plotting All Results
```python
from pybalmorel import Balmorel

# Load Balmorel
model = Balmorel('path/to/Balmorel')

# Collect results
model.collect_results()

# Plot bar charts with an interactive GUI
model.results.interactive_bar_chart()
```

## Transmission Maps and Energy Balances

Using the collected results below, the examples below illustrate how to plot figures of transmission capacities and save them.

```python
# Plot electricity transmission capacities in the first scenario, year 2050
model.results.plot_map(model.results.sc[0], 'electricity', 2050)

# Plot total heat energy balance in the second scenario, year 2050
model.results.plot_profile('heat', 2050, model.results.sc[1])
```

## Getting Specific Results
The `model.results` is actually a `MainResults` class. The example below illustrates how to get specific results using that class.

```python
from pybalmorel import MainResults

mainresults_files = ['MainResults_SC1.gdx', 'MainResults_SC2.gdx']
paths = ['path/to/folder/with/SC1', 'path/to/folder/with/SC2']
results = MainResults(mainresults_files, paths=paths)
```

If the files are in the same folder, you just need to input a single path to the paths argument. The class will name the scenarios 'SC1' and 'SC2' by default and store them in a list in `results.sc`, but you can also provide your own names with the scenario_names argument.
2 changes: 1 addition & 1 deletion docs/examples/preprocessing.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Pre-Processing

The examples below show how to create single .inc-files, loading all .inc files using the Balmorel class, and defining geography using an interactive GUI.
The examples below show how to create single .inc-files, loading all .inc files using the Balmorel class, and defining geography using an interactive GUI. A [notebook](https://github.com/Mathias157/pybalmorel/blob/master/examples/PreProcessing.ipynb) can also be downloaded from the GitHub repository.

## Create an .inc File
The 'IncFile' class is a handy class for creating .inc files that are the input for Balmorel.
Expand Down

0 comments on commit d5c7c6d

Please sign in to comment.