windkit.io.windio.compose_plant#

windkit.io.windio.compose_plant(name='windkit_export', wwc=None, bwc=None, tswc=None, wind_turbines=None, wtgs=None)[source]#

Compose windIO plant data from multiple windkit objects.

Warning

windIO support is experimental. API may change in future versions.

Creates a complete windIO plant dictionary by combining wind climate data, turbine layouts, and turbine definitions. This is the primary function for building exportable plant files from windkit objects.

Parameters:
  • name (str) – Name for the plant (default: “windkit_export”).

  • wwc (xarray.Dataset, optional) – Weibull Wind Climate dataset. Mutually exclusive with bwc and tswc.

  • bwc (xarray.Dataset, optional) – Binned Wind Climate dataset. Mutually exclusive with wwc and tswc.

  • tswc (xarray.Dataset, optional) – Time Series Wind Climate dataset. Mutually exclusive with wwc and bwc.

  • wind_turbines (xarray.Dataset, optional) – Wind turbines dataset with turbine positions and wtg_key assignments.

  • wtgs (dict, optional) – Dictionary mapping wtg_key strings to WTG datasets. Required if wind_turbines is provided. All wtg_key values in wind_turbines must exist as keys in this dictionary.

Returns:

Complete windIO plant dictionary ready to be written with write_plant().

Return type:

dict

Raises:

ValueError – If more than one wind climate is provided. If wind_turbines is provided without wtgs. If wtg_key values in wind_turbines are missing from wtgs dict.

Examples

>>> import windkit as wk
>>> from windkit.io.windio.translate import compose_plant
>>> from windkit.io.windio import write_plant
>>>
>>> # Load or create windkit objects
>>> tswc = wk.read_tswc("timeseries.csv", crs="EPSG:32632")
>>> turbines = wk.read_wind_turbines("layout.csv", crs="EPSG:32632")
>>> wtg = wk.read_wtg("turbine.wtg")
>>>
>>> # Compose plant
>>> plant = compose_plant(
...     name="My Wind Farm",
...     tswc=tswc,
...     wind_turbines=turbines,
...     wtgs={"IEA_10MW": wtg}
... )
>>>
>>> # Write to file
>>> write_plant(plant, "wind_farm.yaml")