Quickstart
This page walks through generating wind files from the command line and from the
Python API. It assumes pyIECWind is installed (see Installation).
Command-line interface
The pyiecwind command exposes three subcommands.
Generate from an input file
$ pyiecwind run examples/sample_case.ipt -o outputs
This reads an input file (see Input file format (v1)), validates it, and writes one
.wnd file per active condition into outputs/. With no file argument,
pyiecwind run reads pyiecwind.ipt from the current directory. The command
exits non-zero if any condition fails to generate; pass --continue-on-error
to override that.
Write a starter template
$ pyiecwind template my_case.ipt
With no argument this writes pyiecwind_template.ipt. Edit the values and case
rows, then run it.
Guided wizard
$ pyiecwind wizard -o outputs
The wizard prompts for each parameter and condition, then generates the files and (optionally) saves a reproducible input file.
Python API
The same workflow is available programmatically. The public API is small and importable from the top-level package:
from pyiecwind import generate_from_input_file
params, result = generate_from_input_file("examples/sample_case.ipt", output_dir="outputs")
print(f"generated {result.count} files")
To build parameters directly instead of parsing a file:
from pyiecwind import IECParameters, generate_all
params = IECParameters(
si_unit=True, t1=40.0, wtc=2, catg="B", slope_deg=0.0, iec_edition=3,
hh=80.0, dia=80.0, vin=4.0, vrated=10.0, vout=24.0,
conditions=("ECD+R", "EWSV+12.0", "EWM50"),
)
result = generate_all(params, output_dir="outputs")
IECParameters validates on construction and is immutable, so an invalid
turbine definition raises immediately rather than producing a misleading file.
By default generate_all() fails closed (strict=True) - the
first invalid condition raises. See API contract for the full contract.
Next steps
Input file format (v1) - the input file formats and every field.
Theory - the IEC equations behind each case family.
API reference - the full API reference.