diff --git a/examples/Example.py b/docs/Example.py similarity index 100% rename from examples/Example.py rename to docs/Example.py diff --git a/examples/Execution.ipynb b/docs/Execution.ipynb similarity index 100% rename from examples/Execution.ipynb rename to docs/Execution.ipynb diff --git a/examples/PostProcessing.ipynb b/docs/PostProcessing.ipynb similarity index 97% rename from examples/PostProcessing.ipynb rename to docs/PostProcessing.ipynb index 2a17e43..96a2bb4 100644 --- a/examples/PostProcessing.ipynb +++ b/docs/PostProcessing.ipynb @@ -13,24 +13,177 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 1, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "c:\\Users\\mberos\\gitRepos\\pybalmorel\\examples\\files\\MainResults_Example1.gdx\n" + ] + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "3dd833a7b756450099ffa047e9452e55", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "GridBox(children=(Dropdown(description='Table:', layout=Layout(width='80%'), options=('F_CONS_YCRA', 'F_CONS_Y…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "a7ab13dbcf744c6ab4874158fc99e3f6", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Output()" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "8d2f2ec7d8b34c5fa19f1fdc26881efa", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Stack(children=(GridBox(children=(SelectMultiple(description='Scenario', index=(0,), layout=Layout(height='99%…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "a3c01fee0cbd49078bde0fd1ab90efe4", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Output()" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "7f3c74e813ef48c2b41e29f823d3c56e", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "VBox(children=(HBox(children=(Box(children=(Text(value='', description='Title:'), FloatSlider(value=12.0, desc…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "090e62507fd34ecfa758c15444a4a3b6", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Output()" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "1551bbc867ec4d43bfac4412f48dc158", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "HBox()" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "c6243930cb894de9a59d8d5715c811e2", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Output()" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "ed5a4df1c3a049bc94ea94e0b00e9a04", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "VBox(children=(HBox(children=(Box(children=(Button(description='Plot', icon='check', style=ButtonStyle(), tool…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "69ba3d0371ff4038bf7590019b6d141a", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Output()" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "f9fbb3908b8546618463d2d5de81bfd8", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Output()" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "### 0.1 Use development scripts or the package installed from pip\n", - "use_development = True\n", - "if use_development:\n", - " import sys\n", - " import os\n", - " # Adjust the sys.path to include the project root directory\n", - " project_root = os.path.abspath(os.path.join(os.path.dirname(\"__file__\"), '..'))\n", - " if project_root not in sys.path:\n", - " sys.path.insert(0, project_root)\n", - " from src.pybalmorel import MainResults\n", - " from src.pybalmorel.utils import symbol_to_df\n", - "else:\n", - " from pybalmorel import MainResults\n", - " from pybalmorel.utils import symbol_to_df" + "from pybalmorel import MainResults\n", + "\n", + "res = MainResults(files='MainResults_Example1.gdx', paths='files')\n", + "res.interactive_bar_chart()" ] }, { @@ -53,7 +206,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 2, "metadata": {}, "outputs": [ { @@ -300,7 +453,7 @@ "[252 rows x 11 columns]" ] }, - "execution_count": 6, + "execution_count": 2, "metadata": {}, "output_type": "execute_result" } @@ -315,7 +468,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -575,7 +728,7 @@ "[4550 rows x 12 columns]" ] }, - "execution_count": 7, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } @@ -589,9 +742,164 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "2a89837724c542c4b2e174f8490cb972", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "GridBox(children=(Dropdown(description='Table:', layout=Layout(width='80%'), options=('F_CONS_YCRA', 'F_CONS_Y…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "310822ac3e2945d38c8167d66718817b", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Output()" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "886499487ee44448b2a9264f36ae30a2", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Stack(children=(GridBox(children=(SelectMultiple(description='Scenario', index=(0,), layout=Layout(height='99%…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "5eed18fcad6b411da60699fc6689b55f", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Output()" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "cfa775b5667c4def954863d10eaa4b88", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "VBox(children=(HBox(children=(Box(children=(Text(value='', description='Title:'), FloatSlider(value=12.0, desc…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "a0e91bc69c0b4ad498690afd6b276f8d", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Output()" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "eed71e4163164459bb5394e0d6ebe68c", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "HBox()" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "8e2da5dd04494bac823ca12ccdd8e03e", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Output()" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "b08d6d23249446d3abda0212a6e48f27", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "VBox(children=(HBox(children=(Box(children=(Button(description='Plot', icon='check', style=ButtonStyle(), tool…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "98b23d553083416f8658d59cb756cc29", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Output()" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "b7f74d9267d14870bf16db8b2421f94d", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Output()" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "### 1.1.3 Plotting bar charts with an interactive gui\n", "res.interactive_bar_chart()" diff --git a/examples/PreProcessing.ipynb b/docs/PreProcessing.ipynb similarity index 100% rename from examples/PreProcessing.ipynb rename to docs/PreProcessing.ipynb diff --git a/examples/Test_MR.ipynb b/docs/Test_MR.ipynb similarity index 100% rename from examples/Test_MR.ipynb rename to docs/Test_MR.ipynb diff --git a/examples/__init__.py b/docs/__init__.py similarity index 100% rename from examples/__init__.py rename to docs/__init__.py diff --git a/examples/files/Balmorel/Example1/model/MainResults.gdx b/docs/files/Balmorel/Example1/model/MainResults.gdx similarity index 100% rename from examples/files/Balmorel/Example1/model/MainResults.gdx rename to docs/files/Balmorel/Example1/model/MainResults.gdx diff --git a/examples/files/Balmorel/Example2/model/MainResults.gdx b/docs/files/Balmorel/Example2/model/MainResults.gdx similarity index 100% rename from examples/files/Balmorel/Example2/model/MainResults.gdx rename to docs/files/Balmorel/Example2/model/MainResults.gdx diff --git a/examples/files/MainResults_Example1.gdx b/docs/files/MainResults_Example1.gdx similarity index 100% rename from examples/files/MainResults_Example1.gdx rename to docs/files/MainResults_Example1.gdx diff --git a/examples/files/MainResults_Example2.gdx b/docs/files/MainResults_Example2.gdx similarity index 100% rename from examples/files/MainResults_Example2.gdx rename to docs/files/MainResults_Example2.gdx