-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improving symbol_to_df and added a fast .locate_results() function (#23)
* Made symbol_to_df accept variables or equations too * Made function for locating results, if you just want an overview instead of the more heavy loading * Improving docs * Making the plot maps function work for any cases in the commodity input * Release 0.4.3
- Loading branch information
1 parent
2df71c1
commit 39c7936
Showing
11 changed files
with
108 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
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. |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,6 @@ dependencies: | |
- ipykernel>=6.29.5 | ||
- pip | ||
- pip: | ||
- pybalmorel==0.4.2 | ||
- pybalmorel==0.4.3 | ||
``` | ||
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,4 @@ dependencies: | |
- pytest=8.3.3 | ||
- pip | ||
- pip: | ||
- pybalmorel==0.4.2 | ||
- pybalmorel==0.4.3 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[project] | ||
name = "pybalmorel" | ||
version = "0.4.2" | ||
version = "0.4.3" | ||
maintainers = [ | ||
{ name="Mathias Berg Rosendal", email="[email protected]"}, | ||
{ name="Théodore Le Nalinec"}, | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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