Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 13 additions & 71 deletions examples/create_and_update_a_scenario.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,10 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"id": "3ada4b30",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Environment setup complete\n",
" Using ETM API at https://beta.engine.energytransitionmodel.com/api/v3\n",
" Token loaded? True\n",
"API connection ready\n"
]
}
],
"outputs": [],
"source": [
"from example_helpers import setup_notebook\n",
"from pyetm.models import Scenario\n",
Expand All @@ -52,7 +41,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"id": "4770e6a9",
"metadata": {},
"outputs": [],
Expand All @@ -77,19 +66,10 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"id": "5a1549ac",
"metadata": {},
"outputs": [
{
"ename": "ScenarioError",
"evalue": "Could not update user values: {'external_coupling_industry_chemical_other_burner_crude_oil_share': ['user: Input should be a valid number, unable to parse string as a number']}",
"output_type": "error",
"traceback": [
"\u001b[31mScenarioError\u001b[39m\u001b[31m:\u001b[39m Could not update user values: {'external_coupling_industry_chemical_other_burner_crude_oil_share': ['user: Input should be a valid number, unable to parse string as a number']}\n"
]
}
],
"outputs": [],
"source": [
"scenario.update_user_values({\n",
" \"co_firing_biocoal_share\": 80.0,\n",
Expand All @@ -107,31 +87,10 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"id": "7fc4dc21",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Area: nl2019\n",
"End year: 2050\n",
"Start year: 2019\n",
"Version: beta\n",
"Modified inputs: 1\n",
"First input: co_firing_biocoal_share = 80.0\n"
]
},
{
"ename": "IndexError",
"evalue": "list index out of range",
"output_type": "error",
"traceback": [
"\u001b[31mIndexError\u001b[39m\u001b[31m:\u001b[39m list index out of range\n"
]
}
],
"outputs": [],
"source": [
"print(f\"Area: {scenario.area_code}\")\n",
"print(f\"End year: {scenario.end_year}\")\n",
Expand All @@ -153,18 +112,10 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"id": "c6a65f6a",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"False\n"
]
}
],
"outputs": [],
"source": [
"scenario.update_metadata(\n",
" private= True,\n",
Expand Down Expand Up @@ -195,19 +146,10 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"id": "98ab2f5c",
"metadata": {},
"outputs": [
{
"ename": "AttributeError",
"evalue": "'Scenario' object has no attribute 'remove_inputs'",
"output_type": "error",
"traceback": [
"\u001b[31mAttributeError\u001b[39m\u001b[31m:\u001b[39m 'Scenario' object has no attribute 'remove_inputs'\n"
]
}
],
"outputs": [],
"source": [
"scenario.remove_user_values([\"co_firing_biocoal_share\"])\n",
"user_vals = scenario.user_values()\n",
Expand All @@ -217,7 +159,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "pyetm-FWBOHxp3",
"display_name": "pyetm-qKH2ozgc",
"language": "python",
"name": "python3"
},
Expand All @@ -231,7 +173,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.11"
"version": "3.12.9"
}
},
"nbformat": 4,
Expand Down
Loading