Skip to content

Commit 255be72

Browse files
authored
Merge pull request #140 from wind-python/dev
Merge into master for release 0.2.2
2 parents 70f09b4 + 8f11ea4 commit 255be72

35 files changed

+709
-206
lines changed

.github/workflows/tests-coverage.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Tests with pytest the package and monitors the coverage and sends it to coveralls.io
2+
# Coverage is only send to coveralls.io when no pytest tests fail
3+
name: "Tests & Coverage"
4+
5+
on: [push]
6+
7+
# Cancel jobs on new push
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
build:
14+
name: "${{ matrix.name-suffix }} at py${{ matrix.python-version }} on ${{ matrix.os }}"
15+
runs-on: ${{ matrix.os }}
16+
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
include:
21+
- name-suffix: "coverage"
22+
os: ubuntu-latest
23+
python-version: "3.11"
24+
- name-suffix: "basic"
25+
os: ubuntu-latest
26+
python-version: "3.10"
27+
- name-suffix: "basic"
28+
os: ubuntu-latest
29+
python-version: "3.12"
30+
- name-suffix: "basic"
31+
os: windows-latest
32+
python-version: "3.11"
33+
34+
steps:
35+
- name: Checkout repo
36+
uses: actions/checkout@v3
37+
38+
- name: Set up Python
39+
uses: actions/setup-python@v4
40+
with:
41+
python-version: ${{ matrix.python-version }}
42+
43+
- name: Set up Conda
44+
if: runner.os == 'Windows'
45+
uses: conda-incubator/setup-miniconda@v2
46+
with:
47+
miniconda-version: "latest"
48+
python-version: ${{ matrix.python-version }}
49+
activate-environment: testenv
50+
51+
- name: Install dependencies
52+
run: |
53+
python -m pip install --upgrade pip wheel setuptools
54+
python -m pip install .[dev]
55+
56+
- name: Run tests
57+
if: ${{ !(runner.os == 'Linux' && matrix.python-version == 3.9 && matrix.name-suffix == 'coverage') }}
58+
run: |
59+
python -m pytest --disable-warnings --color=yes -v
60+
61+
- name: Run tests, coverage and send to coveralls
62+
if: runner.os == 'Linux' && matrix.python-version == 3.9 && matrix.name-suffix == 'coverage'
63+
run: |
64+
coverage run --source=windpowerlib -m pytest --disable-warnings --color=yes -v
65+
coveralls
66+
env:
67+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68+
COVERALLS_SERVICE_NAME: github

.readthedocs.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# .readthedocs.yml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
# Build documentation in the docs/ directory with Sphinx
9+
sphinx:
10+
configuration: doc/conf.py
11+
12+
# Build documentation with MkDocs
13+
#mkdocs:
14+
# configuration: mkdocs.yml
15+
16+
# Optionally build your docs in additional formats such as PDF and ePub
17+
formats: all
18+
19+
# Optionally set the version of Python and requirements required to build your docs
20+
python:
21+
install:
22+
- requirements: doc/requirements.txt
23+
24+
# Set the version of Python
25+
build:
26+
os: ubuntu-22.04
27+
tools:
28+
python: "3.11"

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ language: python
22

33
matrix:
44
include:
5-
- python: 3.6
6-
- python: 3.7
7-
- python: 3.8
5+
- python: 3.10
6+
- python: 3.11
7+
- python: 3.12
88

99
# command to install dependencies
1010
#before_install:

README.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ Go to the `download page <http://readthedocs.org/projects/windpowerlib/downloads
3333
Installation
3434
============
3535

36-
If you have a working Python 3 (>= 3.6) environment, use pypi to install the latest windpowerlib version:
36+
If you have a working Python 3 environment, use pypi to install the latest windpowerlib version:
3737

3838
::
3939

4040
pip install windpowerlib
4141

42-
The windpowerlib is designed for Python 3 and tested on Python >= 3.5. We highly recommend to use virtual environments.
42+
The windpowerlib is designed for Python 3 and tested on Python >= 3.10. We highly recommend to use virtual environments.
4343
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.
4444

4545
Optional Packages
@@ -97,8 +97,8 @@ To update your local files with the latest version of the `oedb turbine library
9797

9898
.. code:: python
9999
100-
from windpowerlib.wind_turbine import load_turbine_data_from_oedb
101-
load_turbine_data_from_oedb()
100+
from windpowerlib.data import store_turbine_data_from_oedb
101+
store_turbine_data_from_oedb()
102102
103103
If you find your turbine in the database it is very easy to use it in the
104104
windpowerlib

doc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969

7070
# General information about the project.
7171
project = u'windpowerlib'
72-
copyright = u'2016-2021, oemof developer group'
72+
copyright = u'2016-2023, oemof developer group'
7373
author = u'oemof developer group'
7474

7575
import windpowerlib

doc/getting_started.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ If you have a working Python 3 environment, use pypi to install the latest windp
4343

4444
pip install windpowerlib
4545

46-
The windpowerlib is designed for Python 3 and tested on Python >= 3.5. We highly recommend to use virtual environments.
46+
The windpowerlib is designed for Python 3 and tested on Python >= 3.10. We highly recommend to use virtual environments.
4747
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.
4848

4949
Optional Packages
@@ -69,9 +69,9 @@ The basic usage of the windpowerlib is shown in the ModelChain example that is a
6969
To run the example you need the example weather and turbine data used:
7070

7171
* :download:`Example weather data file <../example/weather.csv>`
72-
* :download:`Example power curve data file <../example/data/power_curves.csv>`
73-
* :download:`Example power coefficient curve data file <../example/data/power_coefficient_curves.csv>`
74-
* :download:`Example nominal power data file <../example/data/turbine_data.csv>`
72+
* :download:`Example power curve data file <../windpowerlib/data/default_turbine_data/power_curves.csv>`
73+
* :download:`Example power coefficient curve data file <../windpowerlib/data/default_turbine_data/power_coefficient_curves.csv>`
74+
* :download:`Example nominal power data file <../windpowerlib/data/default_turbine_data/turbine_data.csv>`
7575

7676
Furthermore, you have to install the windpowerlib and to run the notebook you also need to install `notebook` using pip3. To launch jupyter notebook type ``jupyter notebook`` in the terminal.
7777
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
@@ -102,8 +102,8 @@ To update your local files with the latest version of the `oedb turbine library
102102

103103
.. code:: python
104104
105-
from windpowerlib.wind_turbine import load_turbine_data_from_oedb
106-
load_turbine_data_from_oedb()
105+
from windpowerlib.data import store_turbine_data_from_oedb
106+
store_turbine_data_from_oedb()
107107
108108
If you find your turbine in the database it is very easy to use it in the
109109
windpowerlib
@@ -223,4 +223,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
223223
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
224224
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
225225
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
226-
SOFTWARE.
226+
SOFTWARE.

doc/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
sphinx>=1.4
2+
sphinx_rtd_theme
23
ipykernel
34
nbsphinx
45
pandas

doc/whats_new.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ These are new features and improvements of note in each release
88
:local:
99
:backlinks: top
1010

11+
.. include:: whatsnew/v0-2-2.rst
1112
.. include:: whatsnew/v0-2-1.rst
1213
.. include:: whatsnew/v0-2-0.rst
1314
.. include:: whatsnew/v0-1-3.rst

doc/whatsnew/v0-2-2.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
v0.2.2 (February 20, 2024)
2+
++++++++++++++++++++++++++++++
3+
4+
* Updated the code basis to work for newer versions of python (support for python 3.6 to
5+
python 3.9 is discontinued, supported python versions are now >= python 3.9) and added
6+
github actions to run tests automatically when changes are pushed to github
7+
(`PR 136 <https://github.com/wind-python/windpowerlib/pull/136>`_).
8+
9+
Contributors
10+
############
11+
* Birgit Schachler
12+
* Florian Maurer

example/modelchain_example.ipynb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@
144144
" file,\n",
145145
" index_col=0,\n",
146146
" header=[0, 1],\n",
147-
" date_parser=lambda idx: pd.to_datetime(idx, utc=True))\n",
147+
" )\n",
148+
" weather_df.index = pd.to_datetime(weather_df.index, utc=True)\n",
148149
" \n",
149150
" # change time zone\n",
150151
" weather_df.index = weather_df.index.tz_convert(\n",
@@ -517,7 +518,7 @@
517518
" x='wind_speed', y='value', style='*',\n",
518519
" title='Enercon E126 power coefficient curve')\n",
519520
" plt.xlabel('Wind speed in m/s')\n",
520-
" plt.ylabel('Power in W')\n",
521+
" plt.ylabel('Power coefficient $\\mathrm{C}_\\mathrm{P}$')\n",
521522
" plt.show()\n",
522523
" if e126.power_curve is not None:\n",
523524
" e126.power_curve.plot(x='wind_speed', y='value', style='*',\n",

0 commit comments

Comments
 (0)