Skip to content

Commit 897e4ea

Browse files
vezelibirgits
authored andcommitted
Add Binder to the project (#85)
* Setup Binder environment postBuild sets up Docker container and adds missing dependencies for running notebooks in Binder. * Add Binder badge and modify README.rst
1 parent 55f26c1 commit 897e4ea

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed

README.rst

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
:target: https://coveralls.io/github/wind-python/windpowerlib?branch=dev
55
.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.824267.svg
66
:target: https://doi.org/10.5281/zenodo.824267
7+
.. image:: https://mybinder.org/badge_logo.svg
8+
:target: https://mybinder.org/v2/gh/wind-python/windpowerlib/dev?filepath=example
79

810
Introduction
911
=============
@@ -50,26 +52,28 @@ Matplotlib can be installed using pip:
5052
Examples and basic usage
5153
=========================
5254

55+
The simplest way to run the example notebooks without installing windpowerlib is to click `here <https://mybinder.org/v2/gh/wind-python/windpowerlib/dev?filepath=example>`_ and open them with Binder.
56+
5357
The basic usage of the windpowerlib is shown in the `ModelChain example <http://windpowerlib.readthedocs.io/en/stable/modelchain_example_notebook.html>`_ that is available as jupyter notebook and python script:
5458

55-
* `ModelChain example (Python script) <https://raw.githubusercontent.com/wind-python/windpowerlib/master/example/modelchain_example.py>`_
56-
* `ModelChain example (Jupyter notebook) <https://raw.githubusercontent.com/wind-python/windpowerlib/master/example/modelchain_example.ipynb>`_
59+
* `ModelChain example (Python script) <https://raw.githubusercontent.com/wind-python/windpowerlib/master/example/modelchain_example.py>`_
60+
* `ModelChain example (Jupyter notebook) <https://raw.githubusercontent.com/wind-python/windpowerlib/master/example/modelchain_example.ipynb>`_
5761

5862
To run the example you need the example weather and turbine data used:
5963

60-
* `Example weather data file <https://raw.githubusercontent.com/wind-python/windpowerlib/master/example/weather.csv>`_
61-
* `Example power curve data file <https://raw.githubusercontent.com/wind-python/windpowerlib/master/example/data/example_power_curves.csv>`_
62-
* `Example power coefficient curve data file <https://raw.githubusercontent.com/wind-python/windpowerlib/master/example/data/example_power_coefficient_curves.csv>`_
63-
* `Example nominal power data file <https://raw.githubusercontent.com/wind-python/windpowerlib/master/example/data/example_turbine_data.csv>`_
64+
* `Example weather data file <https://raw.githubusercontent.com/wind-python/windpowerlib/master/example/weather.csv>`_
65+
* `Example power curve data file <https://raw.githubusercontent.com/wind-python/windpowerlib/master/example/data/example_power_curves.csv>`_
66+
* `Example power coefficient curve data file <https://raw.githubusercontent.com/wind-python/windpowerlib/master/example/data/example_power_coefficient_curves.csv>`_
67+
* `Example nominal power data file <https://raw.githubusercontent.com/wind-python/windpowerlib/master/example/data/example_turbine_data.csv>`_
6468

65-
Furthermore, you have to install the windpowerlib. To run the notebook you also need to install `notebook` using pip3. To launch jupyter notebook type ``jupyter notebook`` in the terminal.
69+
To run the examples locally you have to install windpowerlib. To run the notebook you also need to install `notebook` using pip3. To launch jupyter notebook type ``jupyter notebook`` in the terminal.
6670
This will open a browser window. Navigate to the directory containing the notebook to open it. See the jupyter notebook quick start guide for more information on `how to install <http://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/install.html>`_ and
67-
`how to run <http://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/execute.html>`_ jupyter notebooks.
71+
`how to run <http://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/execute.html>`_ jupyter notebooks. In order to reproduce the figures in a notebook you need to install `matplotlib`.
6872

6973
Further functionalities, like the modelling of wind farms and wind turbine clusters, are shown in the `TurbineClusterModelChain example <http://windpowerlib.readthedocs.io/en/stable/turbine_cluster_modelchain_example_notebook.html>`_. As the ModelChain example it is available as jupyter notebook and as python script. The weather and turbine datadata used in this example is the same as in the example above.
7074

71-
* `TurbineClusterModelChain example (Python script) <https://raw.githubusercontent.com/wind-python/windpowerlib/master/example/turbine_cluster_modelchain_example.py>`_
72-
* `TurbineClusterModelChain example (Jupyter notebook) <https://raw.githubusercontent.com/wind-python/windpowerlib/master/example/turbine_cluster_modelchain_example.ipynb>`_
75+
* `TurbineClusterModelChain example (Python script) <https://raw.githubusercontent.com/wind-python/windpowerlib/master/example/turbine_cluster_modelchain_example.py>`_
76+
* `TurbineClusterModelChain example (Jupyter notebook) <https://raw.githubusercontent.com/wind-python/windpowerlib/master/example/turbine_cluster_modelchain_example.ipynb>`_
7377

7478
You can also look at the examples in the `Examples section <http://windpowerlib.readthedocs.io/en/stable/examples.html>`_.
7579

@@ -153,4 +157,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
153157
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
154158
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
155159
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
156-
SOFTWARE.
160+
SOFTWARE.

postBuild

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Used by https://mybinder.org for setting up Docker container.
2+
#
3+
# setup.py does not specify matplotlib in ``install_requires``, therefore, in
4+
# order to produce plots in Binder install matplotlib:
5+
python -m pip install matplotlib

0 commit comments

Comments
 (0)