-
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.
- Loading branch information
0 parents
commit 551c336
Showing
105 changed files
with
9,993 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: a188b011f882c2d6f1055ea14894e72b | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+7.54 KB
.doctrees/autoapi/pybalmorel/interactive/interactive_functions/index.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+17.2 KB
.doctrees/autoapi/pybalmorel/plotting/production_profile/index.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# About this code | ||
|
||
This documentation is under construction |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
API Reference | ||
============= | ||
|
||
This page contains auto-generated API reference documentation [#f1]_. | ||
|
||
.. toctree:: | ||
:titlesonly: | ||
|
||
/autoapi/pybalmorel/index | ||
|
||
.. [#f1] Created with `sphinx-autoapi <https://github.com/readthedocs/sphinx-autoapi>`_ |
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 |
---|---|---|
@@ -0,0 +1,177 @@ | ||
pybalmorel.classes | ||
================== | ||
|
||
.. py:module:: pybalmorel.classes | ||
.. autoapi-nested-parse:: | ||
|
||
Created on 08.06.2024 | ||
|
||
@author: Mathias Berg Rosendal, PhD Student at DTU Management (Energy Economics & Modelling) | ||
|
||
|
||
|
||
Classes | ||
------- | ||
|
||
.. autoapisummary:: | ||
|
||
pybalmorel.classes.MainResults | ||
pybalmorel.classes.IncFile | ||
pybalmorel.classes.Balmorel | ||
|
||
|
||
Module Contents | ||
--------------- | ||
|
||
.. py:class:: MainResults(files: Union[str, list, tuple], paths: Union[str, list, tuple] = '.', scenario_names: Union[str, list, tuple] = None, system_directory: str = None) | ||
.. py:attribute:: files | ||
.. py:attribute:: paths | ||
.. py:attribute:: sc | ||
.. py:attribute:: db | ||
.. py:method:: get_result(symbol: str, cols: str = 'None') -> pandas.DataFrame | ||
Get a certain result from the loaded gdx file(s) into a pandas DataFrame | ||
|
||
Args: | ||
symbol (str): The desired result, e.g. PRO_YCRAGF | ||
cols (str, optional): Specify custom columns. Defaults to pre-defined formats. | ||
|
||
Returns: | ||
pd.DataFrame: The output DataFrame | ||
|
||
|
||
|
||
.. py:method:: interactive_bar_chart() | ||
GUI for bar chart plotting | ||
|
||
|
||
|
||
.. py:method:: plot_profile(commodity: str, year: int, scenario: str = 0, columns: str = 'Technology', region: str = 'ALL', style: str = 'light') -> Tuple[matplotlib.figure.Figure, matplotlib.axes.Axes] | ||
Plots the production profile of a commodity, in a year, for a certain scenario | ||
|
||
Args: | ||
commodity (str): The commodity (Electricity, Heat or Hydrogen) | ||
year (int): The model year to plot | ||
scenario (str, optional): Defaults to the first scenario in MainResults. | ||
columns (str, optional): Technology or Fuel as . Defaults to 'Technology'. | ||
region (str, optional): Which country, region or area to plot. Defaults to 'ALL'. | ||
style (str, optional): Plot style, light or dark. Defaults to 'light'. | ||
|
||
Returns: | ||
Figure, Axes: The figure and axes objects for further manipulations | ||
|
||
|
||
|
||
.. py:method:: plot_map(scenario: str, commodity: str, year: int, path_to_geofile: str = None, bypass_path: str = None, geo_file_region_column: str = 'id', style: str = 'light') -> Tuple[matplotlib.figure.Figure, matplotlib.axes.Axes] | ||
Plots the transmission capacities in a scenario, of a certain commodity | ||
|
||
Args: | ||
path_to_result (str): Path to the .gdx file | ||
scenario (str): The scenario name | ||
commodity (str): Electricity or hydrogen | ||
year (int): Model year | ||
path_to_geofile (str, optional): The path to the fitting geofile. Defaults to '../geofiles/2024 BalmorelMap.geojson' in package directory. | ||
bypass_path (str, optional): Extra coordinates for transmission lines for beauty. Defaults to '../geofiles/bypass_lines' in package directory. | ||
geo_file_region_column (str, optional): The columns containing the region names of MainResults. Defaults to 'id'. | ||
style (str, optional): Plot style. Defaults to 'light'. | ||
|
||
Returns: | ||
Tuple[Figure, Axes]: The figure and axes objects of the plot | ||
|
||
|
||
|
||
.. py:method:: _existing_func_wrapper(function, *args, **kwargs) | ||
.. py:class:: IncFile(prefix: str = '', body: str = '', suffix: str = '', name: str = 'name', path: str = 'Balmorel/base/data/') | ||
A useful class for creating .inc-files for GAMS models | ||
Args: | ||
prefix (str): The first part of the .inc file. | ||
body (str): The main part of the .inc file. | ||
suffix (str): The last part of the .inc file. | ||
name (str): The name of the .inc file. | ||
path (str): The path to save the file, defaults to 'Balmorel/base/data'. | ||
|
||
|
||
.. py:attribute:: prefix | ||
.. py:attribute:: body | ||
.. py:attribute:: suffix | ||
.. py:attribute:: name | ||
.. py:attribute:: path | ||
.. py:method:: body_concat(df: pandas.DataFrame) | ||
Concatenate a body temporarily being a dataframe to another dataframe | ||
|
||
|
||
|
||
|
||
.. py:method:: body_prepare(index: list, columns: list, values: str = 'Value', aggfunc: str = 'sum', fill_value: Union[str, int] = '') | ||
.. py:method:: save() | ||
.. py:class:: Balmorel(model_folder: str, gams_system_directory: str = None) | ||
A class that recognises the Balmorel folder structure, can be used to run scenarios or results | ||
|
||
Args: | ||
model_folder (str): The top level folder of Balmorel, where base and simex are located | ||
|
||
|
||
.. py:attribute:: _gams_system_directory | ||
.. py:attribute:: path | ||
.. py:attribute:: scenarios | ||
.. py:attribute:: input_data | ||
.. py:method:: collect_results() | ||
.. py:method:: run(scenario: str, cmd_line_options: dict = {}) | ||
.. py:method:: load_incfiles(scenario: str = 'base', use_provided_read_files: bool = True, read_file: str = 'Balmorel_ReadData') | ||
Will load .inc files from the specific scenario | ||
|
||
Args: | ||
scenario (str, optional): The scenario that you . Defaults to 'base'. | ||
use_provided_read_files (bool, optional): Use provided Balmorel_ReadData.gms and Balmorelbb4_ReadData.inc. Defaults to True. | ||
read_file (str, optional): The name of the read file to be executed. Defaults to Balmorel_ReadData | ||
|
||
Raises: | ||
KeyError: _description_ | ||
|
||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
pybalmorel.formatting | ||
===================== | ||
|
||
.. py:module:: pybalmorel.formatting | ||
.. autoapi-nested-parse:: | ||
|
||
Created on 03.06.2024 | ||
|
||
@author: Mathias Berg Rosendal, PhD Student at DTU Management (Energy Economics & Modelling) | ||
|
||
|
||
|
||
Attributes | ||
---------- | ||
|
||
.. autoapisummary:: | ||
|
||
pybalmorel.formatting.tech_colours | ||
pybalmorel.formatting.fuel_colours | ||
pybalmorel.formatting.balmorel_colours | ||
pybalmorel.formatting.mberos_colours | ||
pybalmorel.formatting.mainresult_symbol_columns | ||
pybalmorel.formatting.mainresults_symbol_columns | ||
|
||
|
||
Module Contents | ||
--------------- | ||
|
||
.. py:data:: tech_colours | ||
.. py:data:: fuel_colours | ||
.. py:data:: balmorel_colours | ||
.. py:data:: mberos_colours | ||
.. py:data:: mainresult_symbol_columns | ||
.. py:data:: mainresults_symbol_columns | ||
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
pybalmorel | ||
========== | ||
|
||
.. py:module:: pybalmorel | ||
Subpackages | ||
----------- | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
/autoapi/pybalmorel/interactive/index | ||
/autoapi/pybalmorel/plotting/index | ||
|
||
|
||
Submodules | ||
---------- | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
/autoapi/pybalmorel/classes/index | ||
/autoapi/pybalmorel/formatting/index | ||
/autoapi/pybalmorel/utils/index | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
pybalmorel.interactive | ||
====================== | ||
|
||
.. py:module:: pybalmorel.interactive | ||
Submodules | ||
---------- | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
/autoapi/pybalmorel/interactive/interactive_functions/index | ||
|
||
|
24 changes: 24 additions & 0 deletions
24
_sources/autoapi/pybalmorel/interactive/interactive_functions/index.rst.txt
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
pybalmorel.interactive.interactive_functions | ||
============================================ | ||
|
||
.. py:module:: pybalmorel.interactive.interactive_functions | ||
Functions | ||
--------- | ||
|
||
.. autoapisummary:: | ||
|
||
pybalmorel.interactive.interactive_functions.interactive_bar_chart | ||
|
||
|
||
Module Contents | ||
--------------- | ||
|
||
.. py:function:: interactive_bar_chart(MainResults_instance) | ||
GUI for bar chart plotting | ||
|
||
MainResults_instance (MainResults): Takes an instance of the MainResults class and opens a GUI for plotting | ||
|
||
|
26 changes: 26 additions & 0 deletions
26
_sources/autoapi/pybalmorel/plotting/LoadGDX/index.rst.txt
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
pybalmorel.plotting.LoadGDX | ||
=========================== | ||
|
||
.. py:module:: pybalmorel.plotting.LoadGDX | ||
.. autoapi-nested-parse:: | ||
|
||
Created on 11.11.2023 | ||
|
||
@author: Mathias Berg Rosendal, PhD Student at DTU Management (Energy Economics & Modelling) | ||
|
||
|
||
|
||
Attributes | ||
---------- | ||
|
||
.. autoapisummary:: | ||
|
||
pybalmorel.plotting.LoadGDX.paths | ||
|
||
|
||
Module Contents | ||
--------------- | ||
|
||
.. py:data:: paths | ||
Oops, something went wrong.