Skip to content

Commit

Permalink
Revise readme
Browse files Browse the repository at this point in the history
  • Loading branch information
uvchik committed Dec 18, 2020
1 parent 7d24823 commit a5f409a
Showing 1 changed file with 107 additions and 84 deletions.
191 changes: 107 additions & 84 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,61 @@
.. deflex documentation master file
========
Overview
========

.. start-badges
.. list-table::
:stub-columns: 1

* - docs
- |docs|
* - tests
- | |travis| |requires|
| |coveralls| |codecov|
* - package
- | |version| |wheel| |supported-versions| |supported-implementations|
| |commits-since|
.. |docs| image:: https://readthedocs.org/projects/deflex/badge/?style=flat
:target: https://readthedocs.org/projects/deflex
:alt: Documentation Status

.. |travis| image:: https://api.travis-ci.org/reegis/deflex.svg?branch=master
:alt: Travis-CI Build Status
:target: https://travis-ci.org/reegis/deflex

.. |requires| image:: https://requires.io/github/reegis/deflex/requirements.svg?branch=master
:alt: Requirements Status
:target: https://requires.io/github/reegis/deflex/requirements/?branch=master

.. |coveralls| image:: https://coveralls.io/repos/reegis/deflex/badge.svg?branch=master&service=github
:alt: Coverage Status
:target: https://coveralls.io/r/reegis/deflex

.. |codecov| image:: https://codecov.io/gh/reegis/deflex/branch/master/graphs/badge.svg?branch=master
:alt: Coverage Status
:target: https://codecov.io/github/reegis/deflex

.. |version| image:: https://img.shields.io/pypi/v/deflex.svg
:alt: PyPI Package latest release
:target: https://pypi.org/project/deflex

.. |wheel| image:: https://img.shields.io/pypi/wheel/deflex.svg
:alt: PyPI Wheel
:target: https://pypi.org/project/deflex

.. |supported-versions| image:: https://img.shields.io/pypi/pyversions/deflex.svg
:alt: Supported versions
:target: https://pypi.org/project/deflex

.. |supported-implementations| image:: https://img.shields.io/pypi/implementation/deflex.svg
:alt: Supported implementations
:target: https://pypi.org/project/deflex

.. |commits-since| image:: https://img.shields.io/github/commits-since/reegis/deflex/v0.1.1.svg
:alt: Commits since latest release
:target: https://github.com/reegis/deflex/compare/v0.2.0b0...master

.. end-badges
.. image:: https://travis-ci.com/reegis/deflex.svg?branch=master
:target: https://travis-ci.com/reegis/deflex
Expand All @@ -21,94 +78,59 @@
.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3572594.svg
:target: https://doi.org/10.5281/zenodo.3572594

Introduction
=============

The deflex library provides a simple heat and power model of Germany. Some
basic scenarios with all data are included.
deflex - flexible multi-regional energy system model forheat, power and mobility

Documentation
~~~~~~~~~~~~~
* Free software: MIT license

The `documentation of deflex <https://deflex.readthedocs.io/en/latest/>`_ is powered by readthedocs.

Go to the `download page <http://readthedocs.org/projects/deflex/downloads/>`_ to download different versions and formats (pdf, html, epub) of the documentation.
.. warning::

deflex is currently under revision. If you are planning to use deflex in
the future you should install the upcoming version (see below)!

Installation
============

On a Linux Debian system you can use the following command to solve all
requirements beforehand.

.. code-block::
sudo apt-get install python3-dev proj-bin libproj-dev libgeos-dev python3-tk libspatialindex-dev virtualenv
We recommend to install the already working beta version::

If you have a working Python 3 environment, use pypi to install the latest deflex version:
pip install https://github.com/reegis/deflex/archive/revise_deflex.zip

::

pip install deflex

The deflex library is designed for Python 3 and tested on Python >= 3.6. We highly recommend to use virtual environments.
Please see the `installation page <http://oemof.readthedocs.io/en/stable/installation_and_setup.html>`_ of the oemof documentation for complete instructions on how to install python and a virtual environment on your operating system.
Use the latest stable (PhD) version of deflex if to run older scenarios::

pip install https://github.com/reegis/deflex/archive/phd.zip

Basic usage
===========

Create a basic scenario as xls-file or collection of csv-files using the following lines.

.. NOTE::

The first run of the following lines may take some hours, because all
needed data will be downloaded, processed and stored locally. On the next
run the stored files will be used.

Use the logger to see the state of the script.

.. code-block:: python
import logging
from deflex import basic_scenario
logging.getLogger()
logger.setLevel(logging.INFO)
basic_scenario.create_basic_scenario(2014, 'de21')
Use the following lines to optimise an existing basic scenario:

.. code-block:: python
scenario = "/path/to/my/scenario.xls"
main.model_scenario(scenario)
import logging
from deflex import main
logging.getLogger()
logger.setLevel(logging.INFO)
main.main(2014, 'de21')
To optimise a user scenario one has to pass the path to the scenario file(s).
Use example
===========

.. code-block:: python
1. Create a local directory (e.g. /home/user/my_example).
2. Download the
`example <https://raw.githubusercontent.com/reegis/deflex/revise_deflex/examples/examples.py>`_
to this new directory.
3. Open the example file and scroll down to the bottom.
4. Replace "/path/to/store/example/files" with the path of your new directory
(e.g. my_path = /home/user/my_example).

import logging
from deflex import main
logging.getLogger()
logger.setLevel(logging.INFO)
main.model_scenario(xls_file='/my/path/to/scenario.xls',
name='my_scenario', rmap='deXX', year=2025)
5. Now execute the example file. The script will download some example
scenarios with results and show some exemplary plots.

It is faster to use csv-files!
Documentation
=============

.. code-block:: python

import logging
from deflex import main
logging.getLogger()
logger.setLevel(logging.INFO)
main.model_scenario(csv_path='/my/path/to/my_csv_files',
name='my_scenario', rmap='deXX', year=2025)
https://deflex.readthedocs.io/

The `documentation of deflex <https://deflex.readthedocs.io/en/latest/>`_ is powered by readthedocs.

Go to the `download page <http://readthedocs.org/projects/deflex/downloads/>`_ to download different versions and formats (pdf, html, epub) of the documentation.



Expand All @@ -126,25 +148,26 @@ Go to the `Zenodo page of deflex <https://doi.org/10.5281/zenodo.3572594>`_ to f
.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3572594.svg
:target: https://doi.org/10.5281/zenodo.3572594

License
============
Development
===========

To run all the tests run::

tox

Note, to combine the coverage data from all the tox environments run:

.. list-table::
:widths: 10 90
:stub-columns: 1

- - Windows
- ::

set PYTEST_ADDOPTS=--cov-append
tox

- - Other
- ::

Copyright (c) 2019 Uwe Krien

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
PYTEST_ADDOPTS=--cov-append tox

0 comments on commit a5f409a

Please sign in to comment.