Skip to content

Commit

Permalink
Strip jupyter output from tutorials
Browse files Browse the repository at this point in the history
  • Loading branch information
simnh committed Mar 14, 2019
1 parent 25f32bd commit 5bc41b7
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 572 deletions.
102 changes: 14 additions & 88 deletions docs/tutorials/datapackage-reader.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 23,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -30,7 +30,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -51,7 +51,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -87,7 +87,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -110,31 +110,9 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'backpressure': <class 'oemof.tabular.facades.BackpressureTurbine'>,\n",
" 'bus': <class 'oemof.solph.network.Bus'>,\n",
" 'conversion': <class 'oemof.tabular.facades.Conversion'>,\n",
" 'dispatchable': <class 'oemof.tabular.facades.Dispatchable'>,\n",
" 'electrical bus': <class 'oemof.solph.custom.ElectricalBus'>,\n",
" 'electrical line': <class 'oemof.solph.custom.ElectricalLine'>,\n",
" 'excess': <class 'oemof.tabular.facades.Excess'>,\n",
" 'extraction': <class 'oemof.tabular.facades.ExtractionTurbine'>,\n",
" 'generator': <class 'oemof.tabular.facades.Generator'>,\n",
" 'link': <class 'oemof.tabular.facades.Link'>,\n",
" 'load': <class 'oemof.tabular.facades.Load'>,\n",
" 'reservoir': <class 'oemof.tabular.facades.Reservoir'>,\n",
" 'shortage': <class 'oemof.tabular.facades.Shortage'>,\n",
" 'storage': <class 'oemof.tabular.facades.Storage'>,\n",
" 'volatile': <class 'oemof.tabular.facades.Volatile'>}\n"
]
}
],
"outputs": [],
"source": [
"typemap = TYPEMAP\n",
"\n",
Expand All @@ -153,33 +131,9 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'bp': \"<oemof.tabular.facades.BackpressureTurbine: 'bp'>\",\n",
" 'bus0': \"<oemof.solph.network.Bus: 'bus0'>\",\n",
" 'bus1': \"<oemof.solph.network.Bus: 'bus1'>\",\n",
" 'coal-st': \"<oemof.tabular.facades.Dispatchable: 'coal-st'>\",\n",
" 'conn1': \"<oemof.tabular.facades.Link: 'conn1'>\",\n",
" 'conn2': \"<oemof.tabular.facades.Link: 'conn2'>\",\n",
" 'demand0': \"<oemof.tabular.facades.Load: 'demand0'>\",\n",
" 'demand1': \"<oemof.tabular.facades.Load: 'demand1'>\",\n",
" 'el-storage': \"<oemof.tabular.facades.Storage: 'el-storage'>\",\n",
" 'ext': \"<oemof.tabular.facades.ExtractionTurbine: 'ext'>\",\n",
" 'gas-bus': \"<oemof.solph.network.Bus: 'gas-bus'>\",\n",
" 'gas-gt': \"<oemof.tabular.facades.Dispatchable: 'gas-gt'>\",\n",
" 'heat-bus': \"<oemof.solph.network.Bus: 'heat-bus'>\",\n",
" 'lignite-st': \"<oemof.tabular.facades.Dispatchable: 'lignite-st'>\",\n",
" 'power2heat': \"<oemof.tabular.facades.Conversion: 'power2heat'>\",\n",
" 'pv': \"<oemof.tabular.facades.Volatile: 'pv'>\",\n",
" 'wind': \"<oemof.tabular.facades.Volatile: 'wind'>\"}\n"
]
}
],
"outputs": [],
"source": [
"# create energy system object\n",
"es = EnergySystem.from_datapackage(\n",
Expand All @@ -203,7 +157,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -231,7 +185,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -250,46 +204,18 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['bus1.csv',\n",
" 'bus0.csv',\n",
" 'heat-bus.csv',\n",
" 'import.csv',\n",
" 'filling_levels.csv',\n",
" 'gas-bus.csv',\n",
" 'capacities.csv']"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"print(listdir(results_path))"
]
},
{
"cell_type": "code",
"execution_count": 32,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'/home/admin/oemof-results/investment/bus1.csv'"
]
},
"execution_count": 32,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"bus = 'bus1'\n",
"path = os.path.join(results_path, (\"\").join([bus, '.csv'])) \n",
Expand Down
39 changes: 8 additions & 31 deletions docs/tutorials/dispatch.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -53,20 +53,9 @@
},
{
"cell_type": "code",
"execution_count": 46,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'/home/admin/projects/oemof-tabular/data/data.xls'"
]
},
"execution_count": 46,
"metadata": {},
"output_type": "execute_result"
}
],
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# datapath for input data from the oemof tabular pacakge\n",
"datapath = os.path.join(\n",
Expand Down Expand Up @@ -96,7 +85,7 @@
},
{
"cell_type": "code",
"execution_count": 65,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -115,21 +104,9 @@
},
{
"cell_type": "code",
"execution_count": 74,
"metadata": {},
"outputs": [
{
"ename": "TypeError",
"evalue": "set expected at most 1 arguments, got 2",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-74-e56083154d3a>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mset\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgenerators\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbus\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mvalues\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstorages\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbus\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mvalues\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mTypeError\u001b[0m: set expected at most 1 arguments, got 2"
]
}
],
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"\n"
]
Expand Down
16 changes: 2 additions & 14 deletions docs/tutorials/facade-usage.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -375,21 +375,9 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [
{
"ename": "NameError",
"evalue": "name 'Model' is not defined",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-1-c4015c46dc49>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mm\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mModel\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mes\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0mm\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0;31m# uncommet to get lp-file (path will be of this file)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mNameError\u001b[0m: name 'Model' is not defined"
]
}
],
"outputs": [],
"source": [
"m = Model(es)\n",
"\n",
Expand Down

0 comments on commit 5bc41b7

Please sign in to comment.