windIO Converter
A python package for converting windIO files/data-structures.
It includes conversion of the
- windIO file/data-structure it self
- From windIO to other formats
- To windIO from other formats
- HAWC2 to windIO
→
- HAWC2 to windIO
It also includes a modules for reading, writing and interacting with the resulting data format. It includes:
Installation
The windio_converter can be installed directly from PyPi with the command:
pip install windio_converter
Installation from source
It can also be install from source using git+ by:
pip install git+https://gitlab.windenergy.dtu.dk/AESOpt/windio-converter.git
This will prompt for the your username and password for Gitlab-Wind unless you already has setup a Personal Access Token.
Dependencies
The windio_converter aims to have a limited number of dependencies and particularly non "pure python" packages, to ensure that it is as easy as possible to install.
Dependencies which include compiled code are:
numpyscipy
The dependencies which are pure python is:
jmespath: A query language for JSON-like data. Makes it easy to extract data from deeply nesteddict's andlist's.ruamel.yaml: Reading and writing YAML files, which is the basis for windIO. This version is pure-python, but with the option to use thePyYAMLC-implementation if speed is important. It also allows to set/get/remove comments in the YAML file from python.aesoptparam: Module for declaring model parameters and settings, which integrates features such as: input type, documentation, validation, parameter linking, etc. It is an extension of the param which allows nested models, data units and more.
Simple example
Below is a simple example of loading a windIO file and converting it to a HAWC2. The example below assumes that you have a windIO file. For a fully functional example see the code below for the IEA-22-280-RWT which is provided as a part of the module.
Converting your own windIO model
# Loading the main converter
from windio_converter import windio_to_hawc2
# Loading reader and writers for windIO and HAWC2
from windio_converter.io import WindIO_dict, HAWC2_dict
# Create the base windIO dict
wio_dict = WindIO_dict()
# Load the windIO file into the dict
filename = "your-windio-file.yaml"
wio_dict.read_yaml(filename)
# Create the converter instance
converter = windio_to_hawc2(
wio_dict.as_dict(), # First argument is the windIO dict to be converted
init_rotor_speed=0.7, # Only required input, the initial rotor-speed
filenames=dict(base_name="your-turbine-base-name") # Optionally setting the base-name for all files
)
# Run the converter (creating a python build dict)
hawc2_pydict = converter.convert()
# Use the python dict to create a HAWC2_dict instance
hawc2_dict = HAWC2_dict(hawc2_pydict)
# You can add additional settings for your HAWC2 file here
#hawc2_dict["htc"].add("simulation")["time_stop"] = 200
# Write the resulting HAWC2 files
hawc2_dict.write_hawc2("your-output-directory")
Working example
Below is a fully working example converting the IEA-22-280-RWT from windIO to HAWC2
# Loading the main converter
from windio_converter import windio_to_hawc2
# Loading reader and writers for windIO and HAWC2
from windio_converter.io import WindIO_dict, HAWC2_dict
# For creating platform independent paths
import os
# Path location for test data
from windio_converter.test import test_path
# Create the base windIO dict
wio_dict = WindIO_dict()
# Load the windIO file into the dict
filename = os.path.join(test_path, "data", "IEA_22MW", "windIO", "IEA-22-280-RWT.yaml")
wio_dict.read_yaml(filename)
# Create the converter instance
converter = windio_to_hawc2(
wio_dict.as_dict(), # First argument is the windIO dict to be converted
init_rotor_speed=0.7, # Only required input, the initial rotor-speed
filenames=dict(base_name="IEA-22MW") # Optionally setting the base-name for all files
)
# Run the converter (creating a python build dict)
hawc2_pydict = converter.convert()
# Use the python dict to create a HAWC2_dict instance
hawc2_dict = HAWC2_dict(hawc2_pydict)
# You can add additional settings for your HAWC2 file here
#hawc2_dict["htc"].add("simulation")["time_stop"] = 200
# Write the resulting HAWC2 files to the execution directory
hawc2_dict.write_hawc2()
Documentation
The documentation with more extensive examples and all features can be found in the documentation here: https://aesopt.pages.windenergy.dtu.dk/windio-converter
Metadata
Release files for windio-converter 0.2.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| windio_converter-0.2.8-py3-none-any.whl | Python 3 | none | any | Details for windio_converter-0.2.8-py3-none-any.whl |
Release files / windio_converter-0.2.8-py3-none-any.whl
| Download URL | windio_converter-0.2.8-py3-none-any.whl |
|---|---|
| Size | 1.1 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1eb1ed36c324d7514d7f53e6df9a6972c48c0ffb0dbf39aa6856fea829c9e16d
|
|
BLAKE2b-256 checksum How to use checksums |
0bce08f0d4e075f3262c666a54bd1acf9dbdba1390943050b361895de9f82a60
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.12
|
Security for windio-converter 0.2.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.