Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin committed Jun 12, 2019
2 parents a969c2b + 009fdec commit f8576e2
Show file tree
Hide file tree
Showing 20 changed files with 125 additions and 73 deletions.
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ include CONTRIBUTING.rst
include LICENSE
include README.rst

include data/data.xls

include tox.ini .travis.yml appveyor.yml

global-exclude *.py[cod] __pycache__ *.so *.dylib *.swp
4 changes: 1 addition & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Installation

We are currently using features which haven't made it to a proper
`oemof` release yet. This means that you have to install `oemof.tabular`
from source, since `pip` `doesn't allow`_ packages on `PyPI` to have
from source, since `pip` doesn't allow packages on `PyPI` to have
dependencies which are not hosted on `PyPI`:

::
Expand All @@ -87,8 +87,6 @@ dependencies which are not hosted on `PyPI`:

You also need at least `pip` version `18.1` for this to work.

.. _doesn't allow: https://pip.pypa.io/en/stable/news/#id58

Documentation
=============

Expand Down
9 changes: 9 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,16 @@
'sphinx.ext.napoleon',
'sphinx.ext.todo',
'sphinx.ext.viewcode',
'sphinx.ext.mathjax',
'nbsphinx'
]


exclude_patterns = ['_build', '**.ipynb_checkpoints']

nbsphinx_allow_errors = True


if os.getenv('SPELLCHECK'):
extensions += 'sphinxcontrib.spelling',
spelling_show_suggestions = True
Expand Down
4 changes: 3 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ Contents
installation
usage
reference/index
tutorials/index
contributing
authors
changelog



Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

3 changes: 2 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
sphinx>=1.3
sphinx-rtd-theme
nbsphinx
jupyter_client
-e .

19 changes: 13 additions & 6 deletions docs/tutorials/datapackage-reader.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Using the datapackage-reader"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -46,7 +53,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"For the results path we will use the name of the datapackage specified above and the home directory of the user."
"The results path points to your home directory, a subdirectory oemof-results and the name of the datapackage specified above."
]
},
{
Expand All @@ -67,7 +74,7 @@
"source": [
"## Setting `attributmap` and `typemap`\n",
"\n",
"The two arguments allow for adjusting the datapackage reader your needs. The `attribute` map lets you specifiy to \n",
"The two arguments allow for adjusting the datapackage reader to your needs. The `attribute` map lets you specifiy to \n",
"map column names of your datapackage resource (field names) to the facades. Take the following example: \n",
"\n",
"The `Load` facade requires the argument `amount`. If you like (for whatever reason) to use a different naming in your csv-file like `total_energy` you can do this be specifying the following: \n",
Expand Down Expand Up @@ -208,7 +215,7 @@
"metadata": {},
"outputs": [],
"source": [
"print(listdir(results_path))"
"print(os.listdir(results_path))"
]
},
{
Expand All @@ -217,9 +224,9 @@
"metadata": {},
"outputs": [],
"source": [
"bus = 'bus1'\n",
"path = os.path.join(results_path, (\"\").join([bus, '.csv'])) \n",
"df = pd.read_csv(path, index_col=0, parse_dates=True)[1:48, 'ccgt'].plot()"
"bus = 'bus0'\n",
"path = os.path.join(results_path, (\"\").join([bus, '.csv']))\n",
"df = pd.read_csv(path, index_col=0, parse_dates=True).loc[:, 'wind'].plot()"
]
}
],
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/facade-usage.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Create Model and Inspect"
"### Create Model and Inspect"
]
},
{
Expand Down
8 changes: 8 additions & 0 deletions docs/tutorials/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Tutorials
=============

.. toctree::
:maxdepth: 1
:glob:

*
16 changes: 1 addition & 15 deletions docs/tutorials/model-from-tabular-data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,17 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Simple Energy System Model of the Lao Electricity System\n",
"\n",
"# Creating energy systems from spreadsheet\n",
"\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Python Imports\n",
"\n",
"Imports of necessary python packages"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%matplotlib inline\n",
"import matplotlib.pyplot as plt \n",
"import seaborn as sn \n",
"\n",
"import os\n",
"import pkg_resources as pkg\n",
"import pandas as pd \n",
Expand Down
7 changes: 3 additions & 4 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,14 @@ full postprocessing functionality we recommend using one of the types listed bel
**Carrier types**

* solar, wind, biomass, coal, lignite, uranium, oil, gas, hydro, waste,
electricity, heat, other
electricity, heat, other

**Tech types**

* st, ocgt, ccgt, ce, pv, onshore, offshore, ror, rsv, phs, ext, bp, battery

We recommend use the following naming convention for your facade names:

bus-carrier-tech-number
We recommend use the following naming convention for your facade names
`bus-carrier-tech-number`

For example: `DE-gas-ocgt-1`.

Expand Down
6 changes: 2 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,9 @@ def read(*names, **kwargs):
install_requires=[
"datapackage",
"geojson",
"oemof @ "
"git+https://git@github.com/oemof/oemof.git"
"@releases/v0_3_0"
"#egg=oemof-0.2.4.dev0",
"oemof==0.3.1",
"pandas>=0.22",
"seaborn",
"paramiko",
"pyproj",
"pyshp",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
name;carrier;tech;storage_capacity;capacity;capacity_cost;invest_relation_output_capacity;invest_relation_input_output;type;bus;tech
el-storage;lithium;battery;;;10;0.2;1;storage;bus0;battery
name;carrier;tech;storage_capacity;capacity;capacity_cost;invest_relation_output_capacity;invest_relation_input_output;expandable;type;bus;tech
el-storage;lithium;battery;;0;10;0.2;1;true;storage;bus0;battery
Original file line number Diff line number Diff line change
Expand Up @@ -375,9 +375,14 @@
"format": "default"
},
{
"name": "invest_relation_input_output",
"type": "number",
"format": "default"
"name": "invest_relation_input_output",
"type": "number",
"format": "default"
},
{
"name": "expandable",
"type": "boolean",
"format": "default"
},
{
"name": "type",
Expand Down
3 changes: 2 additions & 1 deletion src/oemof/tabular/examples/scripting/compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
)

# create path for results (we use the datapackage_dir to store results)
results_path = os.path.join(os.path.expanduser("~"), "oemof-results", name)
results_path = os.path.join(
os.path.expanduser("~"), "oemof-results", name, "output")
if not os.path.exists(results_path):
os.makedirs(results_path)

Expand Down
4 changes: 2 additions & 2 deletions src/oemof/tabular/examples/scripting/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# plot results with plotly

name = "dispatch"
name = "investment"

# results path for output
results_path = os.path.join(
Expand All @@ -16,7 +16,7 @@
offline.plot(
hourly_plot(
name,
"DE",
"bus0",
os.path.join(os.path.expanduser("~"), "oemof-results"),
plot_filling_levels=False,
),
Expand Down

0 comments on commit f8576e2

Please sign in to comment.