Skip to content
6 changes: 3 additions & 3 deletions examples/notebooks/01_minimal_manual_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@
]
},
{
"metadata": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"This code segment sets up a demand unit managed by the \"demand_operator\" unit operator, equipped with a naive demand forecast, and establishes its operational parameters within the electricity market simulation framework.\n",
"\n",
Expand All @@ -249,9 +249,9 @@
]
},
{
"metadata": {},
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"world.add_unit_operator(\"unit_operator\")\n",
Expand Down Expand Up @@ -451,7 +451,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.12"
"version": "3.12.11"
},
"nbsphinx": {
"execute": "never"
Expand Down
2 changes: 1 addition & 1 deletion examples/notebooks/02_automated_run_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.12"
"version": "3.12.11"
},
"nbsphinx": {
"execute": "never"
Expand Down
38 changes: 18 additions & 20 deletions examples/notebooks/03_custom_unit_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,9 @@
"source": [
"## 2. Setting Up ASSUME\n",
"\n",
"Before we create our custom unit, let's set up the ASSUME framework. We'll install the ASSUME core package and clone the repository containing predefined scenarios."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**You don't need to execute the following code cells if you already have the ASSUME framework installed and/or the repository cloned.**"
"Before we create our custom unit, let's set up the ASSUME framework. We recommend to clone the repository containing the actual development state of ASSUME with the predefined scenarios and then run ```pip install -e .```\n",
"\n",
"Before running the notebook, we recommend to get the latest developments by pulling from git."
]
},
{
Expand All @@ -128,21 +123,24 @@
"outputs": [],
"source": [
"import importlib.util\n",
"from packaging.version import parse\n",
"\n",
"\n",
"# Check if 'google.colab' is available\n",
"IN_COLAB = importlib.util.find_spec(\"google.colab\") is not None\n",
"if IN_COLAB:\n",
" !pip install assume-framework"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"if IN_COLAB:\n",
" !git clone --depth=1 https://github.com/assume-framework/assume.git assume-repo"
" # get the latest development version from github\n",
" !git clone --depth=1 https://github.com/assume-framework/assume.git assume-repo\n",
" !pip install -e assume-repo\n",
"else:\n",
" # check version of installed assume package\n",
" try:\n",
" import assume\n",
" if parse(assume.__version__) < parse(\"0.5.0\"):\n",
" raise ImportError(\"Installed assume version is outdated. Run git pull and install the latest development state with 'pip install -e .'\")\n",
" except ImportError:\n",
" # print warning if not installed\n",
" print(\"Assume package not installed. Clone the repository and install it with 'pip install -e .'\")"
]
},
{
Expand Down Expand Up @@ -1244,7 +1242,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.12"
"version": "3.12.11"
},
"nbsphinx": {
"execute": "never"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,39 @@
"source": [
"## 0. Get ASSUME Running\n",
"\n",
"### 0.1 Installation Process\n",
"### 0.1 Repository Setup\n",
"\n",
"We'll start by installing ASSUME in this environment. For Google Colab, we install the ASSUME core package via pip. \n",
"To access predefined simulation scenarios, clone the ASSUME repository. Both in collab and if you are working locally, make sure to pull the latest development state of ASSUME (```git pull```)."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "1fa3f94e",
"metadata": {},
"outputs": [],
"source": [
"import importlib.util\n",
"from packaging.version import parse\n",
"\n",
"# Check whether notebook is run in google colab\n",
"IN_COLAB = importlib.util.find_spec(\"google.colab\") is not None\n",
"\n",
"if IN_COLAB:\n",
" # get the latest development version from github\n",
" !git clone --depth=1 https://github.com/assume-framework/assume.git assume-repo"
]
},
{
"cell_type": "markdown",
"id": "3796554f",
"metadata": {},
"source": [
"### 0.2 Installation\n",
"\n",
"We'll start by installing ASSUME in this environment.\n",
"- For Google Colab, we use the latest ASSUME development state that we just cloned from github.\n",
"- If you are working locally, make sure to also work with the latest dev state (by having pulled and having run ```pip install -e .```).\n",
"\n",
"For comprehensive installation instructions, please refer to our [official documentation](https://assume.readthedocs.io/en/latest/installation.html).\n",
"\n",
Expand All @@ -77,15 +107,27 @@
"outputs": [],
"source": [
"import importlib.util\n",
"from packaging.version import parse\n",
"\n",
"# Check whether notebook is run in google colab\n",
"IN_COLAB = importlib.util.find_spec(\"google.colab\") is not None\n",
"\n",
"if IN_COLAB:\n",
" !pip install assume-framework[learning]\n",
" # Colab currently has issues with pyomo version 6.8.2, causing the notebook to crash\n",
" # Installing an older version resolves this issue. This should only be considered a temporary fix.\n",
" !pip install pyomo==6.8.0"
" !pip install pyomo==6.8.0\n",
" # get the latest development version from github\n",
" !git clone --depth=1 https://github.com/assume-framework/assume.git assume-repo\n",
" !pip install -e ./assume-repo[learning]\n",
"else:\n",
" # check version of installed assume package\n",
" try:\n",
" import assume\n",
" if parse(assume.__version__) < parse(\"0.5.0\"):\n",
" raise ImportError(\"Installed assume version is outdated. Run git pull and install the latest development state with 'pip install -e .'\")\n",
" except ImportError:\n",
" # print warning if not installed\n",
" print(\"Assume package not installed. Clone the repository and install it with 'pip install -e .'\")"
]
},
{
Expand All @@ -98,28 +140,7 @@
" **Dashboard Limitations in Colab**\n",
"> **⚠️ Important:** In Google Colab, we cannot access Docker-dependent functionalities, which means:\n",
"> - Pre-defined dashboards are not available\n",
"> - For full dashboard access, please install Docker and ASSUME on your local machine\n",
"\n",
"### 0.2 Repository Setup\n",
"\n",
"To access predefined simulation scenarios, clone the ASSUME repository (Colab only):"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d5e77f71",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "_5hB0uDisSsg",
"outputId": "1241881f-e090-4f26-9b02-560adfcb3a3e"
},
"outputs": [],
"source": [
"if IN_COLAB:\n",
" !git clone --depth=1 https://github.com/assume-framework/assume.git assume-repo"
"> - For full dashboard access, please install Docker and ASSUME on your local machine"
]
},
{
Expand Down Expand Up @@ -1106,7 +1127,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "assume-framework",
"display_name": "assume",
"language": "python",
"name": "python3"
},
Expand All @@ -1120,7 +1141,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.9"
"version": "3.12.11"
}
},
"nbformat": 4,
Expand Down
3 changes: 2 additions & 1 deletion examples/notebooks/04b_reinforcement_learning_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@
"source": [
"# Only run this cell if you are using Google Colab\n",
"if IN_COLAB:\n",
" !git clone --depth=1 https://github.com/assume-framework/assume.git assume-repo"
" !git clone --depth=1 https://github.com/assume-framework/assume.git assume-repo\n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The installation command in the markdown cell still references the normal installation, there also with ". -e" then?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This happens in multiple tutorials. Please make changes accordingly.

" !pip install -e assume-repo"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@
"source": [
"# Only run this cell if you are using Google Colab\n",
"if IN_COLAB:\n",
" !git clone --depth=1 https://github.com/assume-framework/assume.git assume-repo"
" !git clone --depth=1 https://github.com/assume-framework/assume.git assume-repo\n",
" !pip install -e assume-repo"
]
},
{
Expand Down
7 changes: 3 additions & 4 deletions examples/notebooks/05_market_comparison.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@
"# Check if 'google.colab' is available\n",
"IN_COLAB = importlib.util.find_spec(\"google.colab\") is not None\n",
"\n",
"if IN_COLAB:\n",
" !pip install assume-framework\n",
"!pip install matplotlib"
]
},
Expand All @@ -98,7 +96,8 @@
"outputs": [],
"source": [
"if IN_COLAB:\n",
" !git clone --depth=1 https://github.com/assume-framework/assume.git assume-repo"
" !git clone --depth=1 https://github.com/assume-framework/assume.git assume-repo\n",
" !pip install -e assume-repo"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adjust the comment above that the code does not need to be executed when one has the current dev state installed, not the release.

]
},
{
Expand Down Expand Up @@ -538,7 +537,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.7"
"version": "3.12.11"
},
"nbsphinx": {
"execute": "never"
Expand Down
7 changes: 3 additions & 4 deletions examples/notebooks/06_advanced_orders_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,7 @@
"import importlib.util\n",
"\n",
"# Check if 'google.colab' is available\n",
"IN_COLAB = importlib.util.find_spec(\"google.colab\") is not None\n",
"if IN_COLAB:\n",
" !pip install 'assume-framework'"
"IN_COLAB = importlib.util.find_spec(\"google.colab\") is not None"
]
},
{
Expand All @@ -157,7 +155,8 @@
"outputs": [],
"source": [
"if IN_COLAB:\n",
" !git clone --depth=1 https://github.com/assume-framework/assume.git assume-repo"
" !git clone --depth=1 https://github.com/assume-framework/assume.git assume-repo\n",
" !pip install -e assume-repo"
]
},
{
Expand Down
22 changes: 8 additions & 14 deletions examples/notebooks/07_interoperability_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@
"import importlib.util\n",
"\n",
"# Check if 'google.colab' is available\n",
"IN_COLAB = importlib.util.find_spec(\"google.colab\") is not None\n",
"if IN_COLAB:\n",
" !pip install assume-framework[network]"
"IN_COLAB = importlib.util.find_spec(\"google.colab\") is not None"
]
},
{
Expand All @@ -68,7 +66,8 @@
"outputs": [],
"source": [
"if IN_COLAB:\n",
" !git clone --depth=1 https://github.com/assume-framework/assume.git assume-repo"
" !git clone --depth=1 https://github.com/assume-framework/assume.git assume-repo\n",
" !pip install -e assume-repo"
]
},
{
Expand Down Expand Up @@ -252,14 +251,10 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"vscode": {
"languageId": "shellscript"
}
},
"metadata": {},
"outputs": [],
"source": [
"!cd inputs && git clone https://gitlab.com/dlr-ve/esy/amiris/examples.git amiris-examples"
"!cd inputs && git clone --depth=1 --branch v4.0.0 https://gitlab.com/dlr-ve/esy/amiris/examples.git amiris-examples"
]
},
{
Expand All @@ -284,7 +279,7 @@
"# make sure that you have a database server up and running - preferabely in docker\n",
"# DB_URI = \"postgresql://assume:assume@localhost:5432/assume\"\n",
"# but you can use a file-based sqlite database too:\n",
"data_format = \"local_db\" # \"local_db\" or \"timescale\"\n",
"data_format = \"timescale\" # \"local_db\" or \"timescale\"\n",
"\n",
"if data_format == \"local_db\":\n",
" db_uri = \"sqlite:///local_db/assume_db.db\"\n",
Expand All @@ -307,8 +302,7 @@
"metadata": {},
"source": [
"If you are running locally and have our docker with the database and the Grafana dashboards installed, we can now look at the results here:\n",
"\n",
"http://localhost:3000/d/mQ3Lvkr4k/assume3a-main-overview?orgId=1&var-simulation=amiris_simple&from=1609459200000&to=1609545600000&refresh=5s"
"http://localhost:3000/d/aemnxld4ukgsga/assume3a-main-overview?orgId=1&from=2020-12-31T23:59:59.000Z&to=2021-01-01T23:59:59.000Z&var-simulation=amiris_simple&refresh=5s"
]
},
{
Expand Down Expand Up @@ -442,7 +436,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.6"
"version": "3.12.11"
},
"nbsphinx": {
"execute": "never"
Expand Down
2 changes: 1 addition & 1 deletion examples/notebooks/09_example_Sim_and_xRL.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,11 @@
"IN_COLAB = importlib.util.find_spec(\"google.colab\") is not None\n",
"\n",
"if IN_COLAB:\n",
" !pip install 'assume-framework[learning]'\n",
" !git clone --depth=1 https://github.com/assume-framework/assume.git assume-repo\n",
" # Colab currently has issues with pyomo version 6.8.2, causing the notebook to crash\n",
" # Installing an older version resolves this issue. This should only be considered a temporary fix.\n",
" !pip install pyomo==6.8.0\n",
" !pip install -e ./assume-repo[learning]\n",
"!pip install plotly\n",
"!pip install nbconvert"
]
Expand Down
4 changes: 2 additions & 2 deletions examples/notebooks/10a_DSU_and_flexibility.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@
"IN_COLAB = importlib.util.find_spec(\"google.colab\") is not None\n",
"\n",
"if IN_COLAB:\n",
" !pip install assume-framework\n",
" # Colab currently has issues with pyomo version 6.8.2, causing the notebook to crash\n",
" # Installing an older version resolves this issue. This should only be considered a temporary fix.\n",
" !pip install pyomo==6.8.0\n",
Expand Down Expand Up @@ -179,7 +178,8 @@
"outputs": [],
"source": [
"if IN_COLAB:\n",
" !git clone --depth=1 https://github.com/assume-framework/assume.git assume-repo"
" !git clone --depth=1 https://github.com/assume-framework/assume.git assume-repo\n",
" !pip install -e assume-repo"
]
},
{
Expand Down
Loading