Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • toolbox/WindEnergyToolbox
  • tlbl/WindEnergyToolbox
  • cpav/WindEnergyToolbox
  • frza/WindEnergyToolbox
  • borg/WindEnergyToolbox
  • mmpe/WindEnergyToolbox
  • ozgo/WindEnergyToolbox
  • dave/WindEnergyToolbox
  • mmir/WindEnergyToolbox
  • wluo/WindEnergyToolbox
  • welad/WindEnergyToolbox
  • chpav/WindEnergyToolbox
  • rink/WindEnergyToolbox
  • shfe/WindEnergyToolbox
  • shfe1/WindEnergyToolbox
  • acdi/WindEnergyToolbox
  • angl/WindEnergyToolbox
  • wliang/WindEnergyToolbox
  • mimc/WindEnergyToolbox
  • wtlib/WindEnergyToolbox
  • cmos/WindEnergyToolbox
  • fabpi/WindEnergyToolbox
22 results
Show changes
Commits on Source (320)
Showing
with 709 additions and 68 deletions
*.bin filter=lfs diff=lfs merge=lfs -text
......@@ -18,7 +18,15 @@ wetb/hawc2/tests/test_files/htcfiles/tmp.htc
wetb/hawc2/ascii2bin/tests/test_files/Hawc2ascii_bin.sel
wetb/hawc2/ascii2bin/tests/test_files/Hawc2ascii_bin.dat
wetb/prepost/tests/data/demo_dlc/remote*
wetb/*/*/*.c
.cache/
tests/temp.htc
**/tmp/*
/wetb/fatigue_tools/rainflowcounting/compile.py
/docs/api
/htmlcov
/docs/build
/docs/source_old
.ipynb_checkpoints
/.pytest_cache/
before_script:
- apt-get update
# uncomment first time
#- rm -rf TestFiles
#- git submodule update --init
- git submodule sync
- git submodule update
image: dtuwindenergy/wetb
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
when: never
- when: always
test-3.4:
image: mmpe/wetb
test:
image: continuumio/anaconda3:latest
stage:
test
# except:
# - test_pypi
variables:
GIT_SUBMODULE_STRATEGY: recursive
before_script:
#- git submodule sync --recursive
#- git submodule update --init --recursive
- python -m pip install .[all]
script:
- python3 -m pytest --cov-report term-missing:skip-covered --cov-report xml:coverage.xml --cov=wetb
tags:
- docker, linux, shared
coverage: /(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
# ===== build documentation =====
pages: # "pages" is a job specifically for GitLab pages [1]
stage: # build, test, deploy defined by default [2]
deploy
image: registry.windenergy.dtu.dk/hawc2/hawc2-binary/dockerimages/ubuntu_conda
script: # use sphinx to build docs, move to public page
- pip install --upgrade pip
- pip install sphinx --upgrade
- pip install sphinx sphinx_rtd_theme
- pip install nbsphinx==0.3.5
- pip install git+https://github.com/vidartf/nbsphinx-link.git
- pip install -e .
- cd docs; make html
- cd ../; mv docs/build/html public/
artifacts: # required for GitLab pages [1]
paths:
- public
only: # only run for these branches
- master
- /^test_doc.*/
tags: # only runners with this tag can do the job [3]
- python
allow_failure: true
# Deploy package to local repository
upload_package_local:
image: continuumio/anaconda3:latest
tags:
- docker, linux, shared
stage: deploy
needs:
- job: build_wheel
artifacts: true
- job: test
artifacts: false
script:
- pip install --upgrade twine packaging
- TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python -m twine upload --verbose --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi dist/*
rules:
- if: $CI_COMMIT_TAG != null
when: always
- if: $CI_COMMIT_BRANCH == "master"
when: always
- if: $CI_COMMIT_BRANCH != "master"
when: manual
allow_failure: true
# ===== BUILD WHEELS AND UPLOAD TO PYPI =====
upload_package_pypi:
image: continuumio/anaconda3:latest
tags:
- docker, linux, shared
stage: deploy
needs:
- job: build_wheel
artifacts: true
- job: test
artifacts: false
script:
- pip install --upgrade twine packaging
- twine upload dist/* -u $TWINE_USERNAME -p $TWINE_PASSWORD
only:
- tags
- test_pypi
build_wheel:
stage: build
tags:
- linux, docker, shared
image: registry.windenergy.dtu.dk/hawc2/hawc2-binary/dockerimages/ubuntu_conda
before_script:
- git config --global --add safe.directory ${CI_PROJECT_DIR}
script:
#- python3 setup.py test
- python3 -m pytest --cov=wetb
- pip wheel . --wheel-dir=dist
artifacts:
paths:
- dist/wetb*.whl
expire_in: "1d"
[distutils]
index-servers=
pypi
#testpypi # include this line for testing
[testpypi]
#repository: https://test.pypi.org/legacy/ # use this line when testing
repository: https://upload.pypi.org/legacy/
username: DTUWindEnergy
[![build status](https://gitlab.windenergy.dtu.dk/toolbox/WindEnergyToolbox/badges/master/build.svg)](https://gitlab.windenergy.dtu.dk/toolbox/WindEnergyToolbox/commits/master)
[![coverage report](https://gitlab.windenergy.dtu.dk/toolbox/WindEnergyToolbox/badges/master/coverage.svg)](https://gitlab.windenergy.dtu.dk/toolbox/WindEnergyToolbox/commits/master)
[![pypi status](https://img.shields.io/pypi/v/wetb.png)](https://pypi.python.org/pypi/wetb)
# Introduction
......@@ -17,8 +18,11 @@ Both Python2 and Python3 are supported.
# Installation
- [Simple user](docs/install.md)
- [Developer/contributor](docs/developer-guide.md)
See documentation.
# Documentation
[https://toolbox.pages.windenergy.dtu.dk/WindEnergyToolbox/](https://toolbox.pages.windenergy.dtu.dk/WindEnergyToolbox/)
# Contents of WindEnergyToolbox, [wetb](wetb)
......@@ -38,9 +42,9 @@ Both Python2 and Python3 are supported.
- [Hawc2io](wetb/hawc2/Hawc2io.py): Read binary, ascii and flex result files
- [sel_file](wetb/hawc2/sel_file.py): Read/write *.sel (sensor list) files
- [htc_file](wetb/hawc2/htc_file.py): Read/write/manipulate htc files
- [ae_file](wetb/hawc2/ae_file.py): Read AE (aerodynamic blade layout) files
- [pc_file](wetb/hawc2/pc_file.py): Read PC (profile coefficient) files
- [st_file](wetb/hawc2/st_file.py): Read ST (structural properties) files
- [ae_file](wetb/hawc2/ae_file.py): Read/write/manipulate AE (aerodynamic blade layout) files
- [pc_file](wetb/hawc2/pc_file.py): Read/write/manipulate PC (profile coefficient) files
- [st_file](wetb/hawc2/st_file.py): Read/write/manipulate ST (structural properties) files
- [shear_file](wetb/hawc2/shear_file.py): Create user defined shear file
- [at_time_file](wetb/hawc2/at_time_file.py): Read at output_at_time files
- [log_file](wetb/hawc2/log_file.py): Read and interpret log files
......
Subproject commit cf64c48ffb671d35a457d0539e078bfe3eb07f0b
Subproject commit 167b16d8f1a26161ebc5a258c62389777d133489
FROM continuumio/anaconda3:latest
MAINTAINER Mikkel Friis-Møller <mikf@dtu.dk>
RUN apt-get update && \
apt-get install make && \
apt-get install libgl1-mesa-glx -y && \
apt-get install gcc gfortran -y
RUN conda update -y conda && \
conda install -y sphinx_rtd_theme && \
conda install setuptools_scm mock h5py pytables pytest pytest-cov nose sphinx blosc pbr paramiko && \
conda install scipy pandas matplotlib cython xlrd coverage xlwt openpyxl psutil pandoc twine pypandoc && \
conda install -c conda-forge pyscaffold sshtunnel --no-deps && \
conda clean -y --all
RUN pip install --upgrade pip && \
pip install --no-cache-dir git+https://gitlab.windenergy.dtu.dk/toolbox/WindEnergyToolbox.git
# build image
docker build -t dtuwindenergy/wetb ./
# or pull from docker hub
# create container
docker create -it --name wetb dtuwindenergy/wetb
# start container
docker start wetb
# enter container with bash prompt
docker exec -it wetb bash
# push
docker push dtuwindenergy/wetb
#checkout single branch for testing:
git clone --single-branch --branch test_pypi https://gitlab.windenergy.dtu.dk/toolbox/WindEnergyToolbox.git
#Copy local folder into docker container:
docker cp "C:\Sandbox\Git\WindEnergyToolbox\." wetb:/WETB/
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = python -msphinx
SPHINXPROJ = TOPFARM
SOURCEDIR = .
BUILDDIR = build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
\ No newline at end of file
docs/bladed/Bladed_airfoil.png

46.8 KiB

docs/bladed/Bladed_st_centers.png

43.6 KiB

docs/bladed/Bladed_turbine_coord.png

123 KiB

docs/bladed/HAWC2_c2_def_ccord.png

38.3 KiB

docs/bladed/HAWC2_st_centers.png

15.1 KiB

docs/bladed/HAWC2_turbine_coord.png

121 KiB

%% Cell type:markdown id: tags:
# Bladed to HAWC2 model conversion formulation
%% Cell type:markdown id: tags:
# Coordinate transformation: <br>
The parameters belonging to HAWC2 are showed by $*^H$ and the parameters belonging to Bladed are showed by $*^B$.
$ ----------------------------------$<br>
The blade root coordinate systems of the codes can be transfromed as:
\begin{equation}
\begin{bmatrix} x^H \\ y^H \\ z^H \end{bmatrix} = \begin{bmatrix} 0 & -1 & 0 \\ 1 & 0 & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} x^B \\ y^B \\ z^B \end{bmatrix}
\end{equation}
The transformation matrix is called $R^{H2B}$.
$ ----------------------------------$<br>
The total rotation angle is expressed by $\theta_{CS}^{B}$ which is comupted as:<br>
$\theta_{CS}^{B}$ = -$\theta_p^B$ - $\beta_{\alpha}^B$ <br>
**BE CAREFUL !!!** -> Bladed positive pitch/twist definition are in negative z direction. <br>
Transformation matrix $R^{B2CS}$ from Bladed local cross-section coordinates to the rotor coordinate system. <br>
\begin{equation}
\begin{bmatrix} x^B \\ y^B \\ z^B \end{bmatrix} = \begin{bmatrix} cos(\theta_{CS}^{B}) & sin(\theta_{CS}^{B}) & 0 \\ -sin(\theta_{CS}^{B}) & cos(\theta_{CS}^{B}) & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} x^B_{CS} \\ y^B_{CS} \\ z^B_{CS} \end{bmatrix}
\end{equation}
$ ----------------------------------$<br>
Total transformation from Bladed local coordinates to HAWC2 can be written as: <br>
\begin{equation}
\begin{bmatrix} x^H \\ y^H \\ z^H \end{bmatrix} = R^{H2B} R^{B2CS} \begin{bmatrix} x^B_{CS} \\ y^B_{CS} \\ z^B_{CS} \end{bmatrix}
\end{equation}
$ ----------------------------------$
%% Cell type:markdown id: tags:
## Center positions <br>
HAWC2 defines elastic, shear and mass center according to the half chord (*c2_def*) location in its st files
whereas Bladed measures center positions from leading edge position. The center positions ($x_{LE}^B$ and $y_{LE}^B$) can be defined with respect to the half chord ($x_{c2}^B$ and $y_{c2}^B$) in Bladed coordinate system as: <br>
$x_{c2}^B$ = $x_{LE}^B$ <br>
$y_{c2}^B$ = $y_{LE}^B$ - c/2 <br>
where *c* is the chord length. <br>
These coordinates can be transformed to HAWC2 coordinate system by multiplying them with $R^{H2B}$.
%% Cell type:markdown id: tags:
## Inertia conversion <br>
Bladed has total inertia value *Ip* and radius of gyration ratio *RGRATIO* in its input file. <br>
\begin{equation}
RGRATIO = \dfrac{RG_y}{RG_x}
\end{equation}
\begin{equation}
RG_x^2 = \dfrac{I_x}{m} \; , \; RG_y^2 = \dfrac{I_y}{m}
\end{equation}
where m is mass and $I_x$ is the mass moment of inertia with respect to x axis.
\begin{equation}
Ip = I_x + RGRATIO^2 \times I_x
\end{equation}
The *Ip* is defined with respec to mass center in Bladed whereas it is defined at elastic center in HAWC2. <br>
\begin{equation}
Ip^{ea} = Ip^{cg} + m \times (xyz^{cg} - xyz^{ea})^2
\end{equation}
**BE CAREFUL !!!** -> do not forget to transform inertia results from Bladed coordinate system to HAWC2 coordinate system.
********************************
BLADED to HAWC2 model conversion
********************************
**BLADED** is a tool developed by DNV, and ``wetb`` contains a basic reader that
can interpret a BLADED project file (.prj) and convert the data structures into
an equivalent set of **HAWC2** input files (htc, st, ae, pc).
================================
API and workflow
================================
---------------------------------
Read BLADED project file
---------------------------------
The input from a Bladed model is given in a project file (*prj*) and is formatted
in the XML definition. Within this file the core BLADED inputs are given in the
CDATA field and which according to the XML standards refer to Character Data,
see also `here <https://www.w3resource.com/xml/CDATA-sections.php>`_ and `here
<https://en.wikipedia.org/wiki/CDATA>`_ for a more detailed technical description.
Within the CDATA field a custom BLADED type markup definition is used. The ``wetb``
reader includes an interpreter for this custom BLADED markup and outputs this
data structure to the user as a nested dictionary, and which allows easy access
to all the different key/value pairs defined in the BLADED CDATA field. This
nested dictionary structure is accessible via the variable
``wetb.bladed.readprj.ReadBladedProject.bd``.
Outside the CDATA field the XML data is parsed via the ``lxml`` Python package,
and the entire XML object ``lxml.objectify.fromstring(str)`` is exposed to the user
via the ``wetb.bladed.readprj.ReadBladedProject.xmlroot`` variable.
In ``wetb` the
project file can be read using the following::
from wetb.bladed.readprj import ReadBladedProject
prj = ReadBladedProject('my_bladed_project_file.prj')
# XML object tree (and lxml data object)
prj.xmlroot
# CDATA field as nested dictionary
prj.bd
A convenience function ``wetb.bladed.readprj.ReadBladedProject.get_key`` is also
available to extract a ``numpy`` array, for example as follows::
from wetb.bladed.readprj import ReadBladedProject
prj = ReadBladedProject('my_bladed_project_file.prj')
# the following keys contain a data array
data_arr = prj.get_key('BSTIFFMB', 'EIFLAP')
# which is the similar calling (but excludes data conversion to int/float)
prj.bd['BSTIFFMB']['EIFLAP']
# if a key contains a section with sub-keys, a dictionary is returned:
data_dict = prj.get_key('BSTIFFMB')
# and is similar to
prj.bd['BSTIFFMB']
------------------------------------
Convert BLADED project file to HAWC2
------------------------------------
The class ``wetb.bladed.prj2hawc.Convert2Hawc`` will convert a Bladed project
file into a set of HAWC2 input files. This process assumes that a standard
3 bladed upwind turbine configuration is used, and a generic HAWC2 `htc template
file <https://gitlab.windenergy.dtu.dk/toolbox/WindEnergyToolbox/-/blob/master/wetb/bladed/template.htc>`_
serves as the starting point for the conversion process. Note that the converter
class ``wetb.bladed.prj2hawc.Convert2Hawc`` inherits from
``wetb.bladed.readprj.ReadBladedProject``, and hence will first read the Bladed
project file::
import os
import urllib.request
import shutil
from wetb.bladed.prj2hawc import Convert2Hawc
# download the htc template file,
url = 'https://gitlab.windenergy.dtu.dk/toolbox/WindEnergyToolbox/-/'
url += 'raw/master/wetb/bladed/template.htc'
fname_tmpl = '/path/to/my/template.htc'
with urllib.request.urlopen(url) as response, open(fname_tmpl, 'wb') as fout:
shutil.copyfileobj(response, fout)
# file name of the Bladed project file
fprj = '/path/to/my/bladed.prj'
# initiate the project converter object, will first read the prj file (see above)
prj = Convert2Hawc(fprj)
# convert to the HAWC2 formats: htc, ae, pc and st files
fname_htc = fname_tmpl.replace('template.htc', 'bladed-to-hawc2.htc')
prj.convert(fname_htc)
# note that the ae, pc and st files will be saved in the same directory as
# fname_htc, with .htc replaced by .ae, .pc, .st etc.
================================
Theoretical background
================================
---------------------------------
Coordinate systems
---------------------------------
The coordinate systems used in both codes are different. Note that in HAWC2
coordinate systems of general bodies are defined by the users. However,
the HAWC2 global and blade cross-section coordinate systems are predetermined,
and they differ from Bladed in the following manner:
* Global Bladed *X* axis is positive pointing downwind whereas in HAWC2 the
global *Y* direction is positive in the downwind direction.
* The HAWC2 global *Z* direction is in the same direction as the gravity vector
(positive down), while it is the opposite in Bladed (positive up).
* The Bladed cross-section coordinate system is rotated 90 degrees around *Z* wrt HAWC2.
The figures below illustrate clearly the HAWC2 and Bladed coordinate systems.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Bladed coordinate systems
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. figure:: Bladed_turbine_coord.png
:width: 200
:alt: bladed_turbine_coord
Bladed coordinate system, rotor rotation and radius definition.
.. figure:: Bladed_st_centers.png
:width: 400
:alt: bladed_st_coord
Bladed cross-section structural centers, half chord location and structural pitch definition.
.. figure:: Bladed_airfoil.png
:width: 400
:alt: bladed_airfoil_coord
Bladed airfoil geometric positioning along the blade.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
HAWC2 coordinate systems
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. figure:: HAWC2_turbine_coord.png
:width: 200
:alt: hawc2_turbine_coord
HAWC2 global, tower, shaft, hub, blade-i and meteorological coordinate systems.
.. figure:: HAWC2_st_centers.png
:width: 400
:alt: hawc2_st_ccord
HAWC2 cross-section structural centers, half chord location and structural pitch definition.
.. figure:: HAWC2_c2_def_ccord.png
:width: 400
:alt: hawc2_airfoil_coord
HAWC2 airfoil positioning in blade body coordinates and aerodynamic pitch given as in the *htc* file *c2_def* section.
---------------------------------
Cross-sectional parameters
---------------------------------
Bladed uses isotropic material definitions for all bodies and for the HAWC2
conversion the same isotropic assumption is used. Since the HAWC2 *st* file definition
splits the Young's (*E*) and shear modulus (*G*) from the actual stiffness terms, and Bladed
defines the actual stiffness values (meaning the product of *EI* etc), the
corresponding HAWC2 *st* input simply assumes a value for *E* and *G*, and
specifies the inertia such that the product (i.e. stiffness) is correct.
Bladed defines a mass polar moment of inertia in combination with the ratio
between the mass radii of gyration around the airfoil's center of mass, while
in HAWC2 the radii of gyration in *X* and *Y* direction are given wrt the elastic
center.
---------------------------------
References
---------------------------------
[1] `HAWC2 User Manual v12.8 <http://tools.windenergy.dtu.dk/HAWC2/manual/>`_
[2] Bladed 4.6 Manual
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
sys.path.insert(0, os.path.join(os.path.abspath('.'), '..', '..'))
from wetb import __version__
# -- Project information -----------------------------------------------------
project = 'WETB'
copyright = '2018, DTU Wind Energy'
author = 'DTU Wind Energy'
# The short X.Y version
version = __version__
# The full version, including alpha/beta/rc tags
release = __version__
# -- General configuration ---------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.autosummary',
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
'nbsphinx',
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
# The master toctree document.
master_doc = 'index'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = None
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
html_theme_options = {
# TOC options
#'navigation_depth': 2, # only show 2 levels on left sidebar
'collapse_navigation': False, # don't allow sidebar to collapse
}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# The default sidebars (for documents that don't match any pattern) are
# defined by theme itself. Builtin themes are using these templates by
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
# 'searchbox.html']``.
#
# html_sidebars = {}
# -- Options for HTMLHelp output ---------------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = 'WETBdoc'
# -- Options for LaTeX output ------------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
#(master_doc, 'PyWake.tex', 'PyWake Documentation', 'DTU Wind Energy', 'manual'),
]
# -- Options for manual page output ------------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'wetb', 'WETB Documentation',
[author], 1)
]
# -- Options for Texinfo output ----------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'WETB', 'WETB Documentation',
author, 'WETB', 'Wind Energy Toolbox.',
'Miscellaneous'),
]
# -- Options for Epub output -------------------------------------------------
# Bibliographic Dublin Core info.
epub_title = project
# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
#
# epub_identifier = ''
# A unique identification for the text.
#
# epub_uid = ''
# A list of files that should not be packed into the epub file.
epub_exclude_files = ['search.html']
# -- Extension configuration -------------------------------------------------
......@@ -63,59 +63,46 @@ For all platforms we recommend that you download and install the Anaconda -
a professional grade, full blown scientific Python distribution.
### Installing Anaconda, activate root environment
### Installing Miniconda
* Download and install Anaconda (Python 3.5 version, 64 bit installer is
recommended) from <https://www.continuum.io/downloads>
* Download and install Anaconda (Python 3.8 version, 64 bit installer is
recommended) from <https://docs.conda.io/en/latest/miniconda.html>.
> Note: The Python 2.7 or Python 3.5 choice of Anaconda only affects the
root environment. You can always create additional environments using other
Python versions, see below.
* Update the root Anaconda environment (type in a terminal):
You should now be able to find a `Anaconda Powershell (Miniconda)` or
`Anaconda Prompt (Miniconda)` application launcher. This will drop you in a
terminal alike application, saying something like this:
```
>> conda update --all
(base) C:\Users\>
```
* Activate the Anaconda root environment in a terminal as follows:
and where `(base)` refers to your base Miniconda installation environment.
You can keep the base environment updated as follows (type in a terminal):
```
>> activate
```
and your terminal will do something like:
```
C:\Users\> activate
(root) C:\Users\>
>> conda update --all
```
note that the name of the environment is now a prefix before the current path.
use ```deactivate``` to deactivate the environment.
### Optionally, create other independent Anaconda environments
By using environments you can manage different Python installations with
different versions on your system. Creating environments is as easy as:
different versions on your system independently. Creating environments is as easy as:
```
>> conda create -n py27 python=2.7
>> conda create -n py34 python=3.4
>> conda create -n py35 python=3.5
>> conda create -n py39 python=3.9
```
These environments can be activated as follows:
Where `-n py39` refers any user defined name that describes what is the environment
used for. These environments can then be activated as follows:
```
>> activate py27
>> activate py34
>> activate py35
>> conda activate py39
```
The Python distribution in use will now be located in e.g. \<path_to_anaconda\>/env/py35/
The Python distribution in use will now be located in e.g. \<path_to_anaconda\>/env/py39/
use ```deactivate``` to deactivate the environment.
use ```conda deactivate``` to deactivate the environment.
## Install/build dependencies
......@@ -123,12 +110,11 @@ use ```deactivate``` to deactivate the environment.
- Compiler (```wetb``` contains cython extensions that require a compiler):
- Linux: gcc (should be installed by default)
- Windows:
- Python 2.7: [Microsoft Visual C++ Compiler for Python 2.7](http://aka.ms/vcpython27),
or the [direct link](https://www.microsoft.com/en-gb/download/details.aspx?id=44266).
- Python 3.4: MS Visual Studio 2010
- Python 3.5: MS Visual Studio 2015 or [Visual C++ Build Tools](http://landinghub.visualstudio.com/visual-cpp-build-tools)
- Python 3.5+: MS Visual Studio 2022 or [Visual C++ 2022 Redistributable](https://visualstudio.microsoft.com/downloads/#microsoft-visual-c-redistributable-for-visual-studio-2022)
https://visualstudio.microsoft.com/visual-cpp-build-tools/
- Only one MS Visual Studio version can be installed, but you can for
example install MS Visual Studio 2010 alongside the Visual C++ Build Tools.
example install MS Visual Studio 2022 alongside different Visual C++ Build Tools.
- [numpy](http://www.numpy.org/)
- [cython](http://cython.org/)
- [scipy](http://scipy.org/scipylib/)
......@@ -138,27 +124,25 @@ use ```deactivate``` to deactivate the environment.
- [h5py](http://www.h5py.org/)
- [matplotlib](http://matplotlib.org/)
- [pytables](http://www.pytables.org/)
- [pyscaffold](http://pyscaffold.readthedocs.org/en/)
- [pytest](https://pypi.python.org/pypi/pytest)
- [pytest-cov](https://pypi.python.org/pypi/pytest-cov/)
- six, [future](http://python-future.org/index.html)
- nose, sphinx, blosc, pbr, psutil, coverage, setuptools_scm
- [parimeko](http://www.paramiko.org/)
- nose, sphinx, blosc, pbr, psutil, coverage, six
- [paramiko](http://www.paramiko.org/)
- [sshtunnel](https://github.com/pahaz/sshtunnel)
- [pandoc](http://pandoc.org/) , [pypandoc](https://pypi.python.org/pypi/pypandoc):
- [click](https://click.palletsprojects.com/en/7.x/)
- [jinja2](https://jinja.palletsprojects.com/en/2.10.x/)
convert markdown formatted readme file to rst for PyPi compatibility. See also
issue #22. ```pandoc``` is available in Anaconda. When installing
```pypandoc``` via pip, you have to install ```pandoc``` via your package
manager (Linux/Mac).
- [twine](https://pypi.python.org/pypi/twine): upload package to
[PyPi](https://pypi.python.org/pypi)
Install the necessary Python dependencies using the conda package manager:
```
>> conda install setuptools_scm future h5py pytables pytest pytest-cov nose sphinx blosc pbr paramiko
>> conda install scipy pandas matplotlib cython xlrd coverage xlwt openpyxl psutil pandoc
>> conda install -c conda-forge pyscaffold sshtunnel twine pypandoc --no-deps
conda install mock h5py pytables pytest pytest-cov nose sphinx blosc pbr paramiko
conda install scipy pandas matplotlib cython coverage openpyxl psutil click jinja2
conda install -c conda-forge sshtunnel --no-deps
```
Note that ```--no-deps``` avoids that newer packages from the channel
......@@ -167,11 +151,6 @@ channel. Depending on which packages get overwritten, this might brake your
Anaconda root environment. As such, using ```--no-deps``` should be
used for safety (especially when operating from the root environment).
Note that:
- With Python 2.7, blosc fails to install.
- With Python 3.6, twine, pypandoc fails to install.
## Get wetb
......@@ -261,6 +240,14 @@ To be written
## Make and upload wheels to PyPi
### Linux
For Linux the wheels are now automatically build and pushed to pypi when creating a tag.
### Windows
For Windows the automated build and push to pypi has not yet been implemented and the developer has to follow the manual procedure outlined below:
Workflow for creating and uploading wheels is as follows:
- Make tag: ```git tag "vX.Y.Z"```, and push tag to remote: ```git push --tags```
......@@ -282,4 +269,3 @@ In case of problems:
will fail. This means commit hashes can not be part of the version number.
Note that when your git working directory is not clean, the scheme for automatic
versioning number will add ```dirty``` to the version number.
Fatigue tools
===========================
``wetb`` includes functions to help with the calculation of fatigue
equivalent loads for turbines. The documentation is in a Jupyter
notebook format. You can download the source notebook from the
``wetb`` repository, under ``docs/source/fatigue_tools``.
.. toctree::
:caption: Fatigue tools
:maxdepth: 2
notebooks/Fatigue
\ No newline at end of file