|
7 | 7 |  |
8 | 8 |
|
9 | 9 | `pyIECWind` generates IEC 61400-1 wind-condition `.wnd` files for the OpenFAST |
10 | | -*InflowWind* module. It reproduces the wind-condition models of the legacy NREL |
11 | | -*IECWind* tool behind a typed, validated Python API, a reproducible command-line |
12 | | -interface, and a regression-locked test suite. |
13 | | - |
14 | | -The six classical condition families — `ECD`, `EWS`, `EOG`, `EDC`, `NWP`, and |
15 | | -`EWM` — are supported across SI and English unit systems and IEC 61400-1 |
16 | | -Editions 1 and 3. See [Scope and limitations](docs/limitations.rst) for the |
17 | | -precise boundary of what is implemented. |
18 | | - |
19 | | -## Highlights |
20 | | - |
21 | | -- **Validated inputs.** `IECParameters` is frozen and validated on construction; |
22 | | - invalid turbine definitions fail immediately rather than producing misleading |
23 | | - files. |
24 | | -- **Fail-closed generation.** The batch API raises on the first invalid condition |
25 | | - by default; partial output is opt-in. |
26 | | -- **Verified output.** A committed golden `.wnd` corpus and an independent oracle |
27 | | - derived from the IEC equations lock numeric results |
28 | | - ([Validation](docs/validation.rst)). |
29 | | -- **Three input formats.** An OpenFAST-style table (recommended), a keyed format, |
30 | | - and the legacy positional layout ([Input files](docs/data_sources.rst)). |
31 | | -- **Typed and documented.** `mypy --strict`, NumPy-style docstrings, and a Sphinx |
32 | | - documentation set. |
| 10 | +*InflowWind* module. It implements the IEC 61400-1 wind-condition models |
| 11 | +historically provided by NREL's *IECWind* tool, behind a typed, validated, and |
| 12 | +regression-locked Python API and command-line interface. |
| 13 | + |
| 14 | +It targets compatibility with selected legacy *IECWind*-style workflows. It has |
| 15 | +**not** been validated byte-for-byte against NREL *IECWind* output; see |
| 16 | +[Validation](#validation) for the exact strength of the current evidence. |
33 | 17 |
|
34 | 18 | ## Installation |
35 | 19 |
|
36 | 20 | ```bash |
37 | 21 | python -m pip install pyiecwind |
38 | 22 | ``` |
39 | 23 |
|
40 | | -For a conda environment or a source/development install, see |
41 | | -[Installation](docs/installation.rst). |
| 24 | +Conda and source/development installs are described in |
| 25 | +[docs/installation.rst](docs/installation.rst). |
42 | 26 |
|
43 | 27 | ## Usage |
44 | 28 |
|
45 | | -Generate wind files from an input file: |
| 29 | +Command line: |
46 | 30 |
|
47 | 31 | ```bash |
48 | | -pyiecwind run examples/sample_case.ipt -o outputs |
| 32 | +pyiecwind run examples/sample_case.ipt -o outputs # generate from an input file |
| 33 | +pyiecwind template my_case.ipt # write a starter template |
| 34 | +pyiecwind wizard -o outputs # guided, interactive build |
49 | 35 | ``` |
50 | 36 |
|
51 | | -Write a starter template, or use the guided wizard: |
| 37 | +Python API: |
52 | 38 |
|
53 | | -```bash |
54 | | -pyiecwind template my_case.ipt |
55 | | -pyiecwind wizard -o outputs |
| 39 | +```python |
| 40 | +from pyiecwind import IECParameters, generate_all |
| 41 | + |
| 42 | +params = IECParameters( |
| 43 | + si_unit=True, t1=40.0, wtc=2, catg="B", slope_deg=0.0, iec_edition=3, |
| 44 | + hh=80.0, dia=80.0, vin=4.0, vrated=10.0, vout=24.0, |
| 45 | + conditions=("ECD+R", "EWSV+12.0", "EWM50"), |
| 46 | +) |
| 47 | +result = generate_all(params, output_dir="outputs") |
| 48 | +print(result.count) |
56 | 49 | ``` |
57 | 50 |
|
58 | | -From Python: |
| 51 | +`IECParameters` validates on construction and is immutable; `generate_all` fails |
| 52 | +closed (raises on the first invalid condition) unless `strict=False`. |
59 | 53 |
|
60 | | -```python |
61 | | -from pyiecwind import generate_from_input_file |
| 54 | +## Supported scope |
62 | 55 |
|
63 | | -params, result = generate_from_input_file("examples/sample_case.ipt", output_dir="outputs") |
64 | | -print(f"generated {result.count} files") |
65 | | -``` |
| 56 | +| Aspect | Supported | |
| 57 | +| --- | --- | |
| 58 | +| IEC 61400-1 edition | Editions 1 and 3 (power-law shear exponent alpha = 0.2 / 0.14) | |
| 59 | +| Turbine class | I, II, III (Vref = 50 / 42.5 / 37.5 m/s) | |
| 60 | +| Turbulence category | A, B, C (Iref = 0.16 / 0.14 / 0.12) | |
| 61 | +| Condition families | ECD, EWS, EOG, EDC, NWP, EWM | |
| 62 | +| Unit systems | SI (m, m/s) and English (ft, ft/s) | |
| 63 | +| Inflow inclination | up to 8 deg (larger values warn) | |
66 | 64 |
|
67 | | -See [Quickstart](docs/quickstart.rst) for more. |
| 65 | +### Limitations and non-goals |
68 | 66 |
|
69 | | -## Documentation |
| 67 | +- IEC 61400-1 Edition 2 and other editions are rejected (opt-in legacy coercion only). |
| 68 | +- Turbine class S and site-specific/measured turbulence are not modelled. |
| 69 | +- Speed modifiers are valid only on the rated (`R`) reference. |
| 70 | +- This package generates inflow files; it does not run OpenFAST. |
| 71 | + |
| 72 | +Full detail: [docs/limitations.rst](docs/limitations.rst). |
| 73 | + |
| 74 | +## Validation |
| 75 | + |
| 76 | +Output is protected by three layers of differing strength, documented with a |
| 77 | +per-scenario reproducibility matrix in [docs/validation.rst](docs/validation.rst): |
70 | 78 |
|
71 | | -The full documentation is hosted at |
72 | | -[pyiecwind.readthedocs.io](https://pyiecwind.readthedocs.io/en/latest/). The |
73 | | -source is in [`docs/`](docs/) and builds with Sphinx |
74 | | -(`sphinx-build -W -b html docs docs/_build/html`). Key references: |
| 79 | +1. **Golden regression corpus** - committed reference `.wnd` files regenerated and |
| 80 | + compared on every run. These are generated by this package, so they detect |
| 81 | + *regressions*, not original-formulation errors. |
| 82 | +2. **Independent analytical oracle** - each family's headline quantity is |
| 83 | + recomputed directly from the IEC 61400-1 equations (reference values |
| 84 | + transcribed independently) and compared to the output. |
| 85 | +3. **Property/invariant tests** - durations, row counts, unit scaling, grammar, |
| 86 | + and direction-ramp monotonicity (Hypothesis). |
75 | 87 |
|
76 | | -- [Theory](docs/theory.rst) — the IEC equations behind each case family |
77 | | -- [Input files](docs/data_sources.rst) and [Units](docs/units.rst) |
78 | | -- [API reference](docs/api.rst) and [API contract](docs/api_contract.rst) |
79 | | -- [Validation](docs/validation.rst) and [Scope and limitations](docs/limitations.rst) |
| 88 | +**Tolerance policy:** header/comment lines are compared exactly (version stamp |
| 89 | +masked); numeric data rows are compared column-by-column within +/- 5e-4, half of |
| 90 | +the rendered three-decimal precision. **No external byte-for-byte comparison |
| 91 | +against NREL IECWind binaries has been performed**; such an external reference |
| 92 | +layer is future work. |
| 93 | + |
| 94 | +## Documentation |
| 95 | + |
| 96 | +Hosted at [pyiecwind.readthedocs.io](https://pyiecwind.readthedocs.io/en/latest/) |
| 97 | +(source in [`docs/`](docs/), built with Sphinx). Highlights: |
| 98 | +[Theory](docs/theory.rst) (IEC equations), [API reference](docs/api.rst), |
| 99 | +[API contract](docs/api_contract.rst), [Input files](docs/data_sources.rst), |
| 100 | +[Units](docs/units.rst). |
80 | 101 |
|
81 | 102 | ## Development |
82 | 103 |
|
|
87 | 108 | pytest --cov=pyiecwind |
88 | 109 | ``` |
89 | 110 |
|
90 | | -Contribution guidelines and the full quality-gate list are in |
91 | | -[Contributing](docs/contributing.rst). |
| 111 | +Quality gates and contribution guidelines: [docs/contributing.rst](docs/contributing.rst). |
| 112 | + |
| 113 | +## Citation |
| 114 | + |
| 115 | +If you use `pyIECWind` in academic work, please cite it. Citation metadata is in |
| 116 | +[`CITATION.cff`](CITATION.cff); GitHub renders a ready-to-use citation from that |
| 117 | +file under *Cite this repository*. |
| 118 | + |
| 119 | +## References |
| 120 | + |
| 121 | +- IEC 61400-1, *Wind turbines - Part 1: Design requirements* (Editions 1 and 3). |
| 122 | +- B. J. Jonkman and M. L. Buhl, *IECWind*, National Renewable Energy Laboratory. |
| 123 | +- OpenFAST *InflowWind* module documentation, National Renewable Energy Laboratory. |
| 124 | + |
| 125 | +See [docs/theory.rst](docs/theory.rst) for the equations and their mapping to the |
| 126 | +implementation. |
92 | 127 |
|
93 | 128 | ## License |
94 | 129 |
|
|
0 commit comments