Bézier for Python users

The `bezier` python package allows you to work with power curve data in python, for time-series and other data analysis purposes.

Installation

The bezier package is available on pypi so is easily installable with pip, poetry or any other python package manager. We recommend the use of the uv package manager for your python environment and dependencies (here's why), so installation is as simple as:

uv add bezier

// Or if you prefer to use pip
pip install bezier

Quick Start

A Turbine Label is a short text label, written-in-lower-kebab-case-0123456789, that can uniquely define a power curve document. Mostly you'll use your own documents directly, but it's great to be able to refer to the examples quickly by their label.

You can use your own turbine power curves, expressed in JSON form. But there are turbines built in to the library for example purposes. You can load them up simply by using the label of that turbine:

>> from bezier import ALL_TURBINE_LABELS
>> print(ALL_TURBINE_LABELS)
[ "gm-5-abc-1", "gm-5-abc-2", ... ]

You can load any of the builtin power curves directly from its label, and inspect its data.

>> curve = PowerCurve('gm-5-abc-1')
>> print(curve.get_description())
"The GM-5-ABC-1 turbine, part of Generic Machines' 5MW platform, is the first totally fictional example turbine I could think of"

Each top level power curve document can represent multiple "modes" of turbine operation. See which ones are available, and which is the default:

>> print(curve.available_modes)
>> print(curve.default_mode)

Use the default mode, and determine the power and thrust for an input time-series of air density and wind speed:

>> mode_label = curve.default_mode
>> operating_point = {
  "air-density": np.array([1.223, 1.224, 1.225, 1.220]),
  "wind-speed": np.array([8.63, 10.89, 11.81, 6.28]),
}
>> power, thrust, parameter_labels, xi = curve.get_performance(mode_label, operating_point, as_timeseries=True)
>> print(power)
np.array([4653000, 4853000, 5053000, 2653000])

Next steps

Check the bezier-python library on GitHub for more advanced use cases and package API documentation.

Last updated

Was this helpful?