Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,9 @@ log/
tests/temp/*
temp/*
brightwind.egg-info/
**/.ipynb_checkpoints
**/.ipynb_checkpoints

### Virtual Environments ###
.venv/
venv/
env/
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,22 @@ Given a version number MAJOR.MINOR.PATCH, increment the:

Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.

---
## [2.7.0]
14-May-2026

### New Features and Enhancements
1. Updated `apply_cleaning_rules()` to support nested boolean conditions (`and`/`or`/`not`) inside the `conditions` block and a new optional `time_range_conditions` block on cleaning rules, in line with the updated BrightHub `/measurement-locations/{uuid}/cleaning-rules` API response. Existing flat-condition cleaning rule files continue to work unchanged. The new `measurement_point_uuid` and `statistic_type_id` fields on `conditions` and `clean_out` items are accepted but currently ignored — column resolution still relies on `assembled_column_name`. The `cleaning_rule.schema.json` was extended with a `time_condition` definition. ([#609](https://github.com/brightwind-dev/brightwind/issues/609))
1. Rewrote `README.md` and `contributing.md` to align with the [docs site](https://brightwind-dev.github.io/brightwind-docs/), with clearer install options (venv / conda), a quick-start example, and an expanded contributing guide covering the fork workflow, editable dev install and running the test suite. ([#602](https://github.com/brightwind-dev/brightwind/issues/602))
2. `test_load_brighthub` is now skipped automatically when no BrightHub credentials are available — either `BRIGHTHUB_CLIENT_ID` and `BRIGHTHUB_CLIENT_SECRET`, or the deprecated `BRIGHTHUB_EMAIL` and `BRIGHTHUB_PASSWORD` — so the test suite runs cleanly without BrightHub credentials. ([#602](https://github.com/brightwind-dev/brightwind/issues/602))
1. Added support for reading Parquet files from BrightHub in `LoadBrightHub.get_data()` via a new `file_extension` argument (one of `'.csv'` or `'.parquet'`). Default remains `'.csv'` for backwards compatibility; Parquet is expected to become the default in the next major release. Reading Parquet requires a parquet engine — install with `pip install brightwind[parquet]` (pyarrow) or `pip install brightwind[parquet-fastparquet]` (fastparquet). ([#601](https://github.com/brightwind-dev/brightwind/issues/601))

### Bug Fixes
1.

### Deprecated
1. The implicit default of `file_extension='.csv'` in `LoadBrightHub.get_data()` is deprecated and will change to `'.parquet'` in the next major release. Calls that do not pass `file_extension` explicitly will emit a `DeprecationWarning`. Pass `file_extension='.csv'` to keep the current behaviour, or `file_extension='.parquet'` to opt in early. ([#601](https://github.com/brightwind-dev/brightwind/issues/601))

---
## [2.6.0]
02-Apr-2026
Expand Down
147 changes: 90 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,106 +13,139 @@

<br>

Brightwind is a Python library specifically built for wind analysis. It can load in wind speed, wind direction and
other metrological timeseries data. There are various plots you can use to understand this data and to find any
potential issues. You can perform many common functions to the data such as shear and long-term adjustments. The
resulting adjusted data is then outputted as a frequency distribution tab file which can be used in wind analysis
software such as WAsP.
Brightwind is an open-source Python library for wind (and solar) resource analysis. It loads meteorological
timeseries data, runs common analyses — shear, long-term adjustments, correlations, distributions — and exports
results to formats used by wind analysis software such as WAsP.

This library can also be used for solar resource analysis.
📚 **Full documentation, tutorials and API reference:** https://brightwind-dev.github.io/brightwind-docs/

<br>

---
### Installation

You can use pip from the command line to install the library.
Install brightwind into its own environment to avoid dependency clashes. Pick whichever option suits you.

#### Option 1 — venv (quick way to try brightwind out)

Check Python is installed (3.9+ recommended):

```bash
python --version
```
C:\Users\Stephen> pip install brightwind
```
It is advisable to use a separate environment to avoid any dependency clashes with other libraries such as Pandas, Numpy
or Matplotlib you may already have installed.

<br>
If not, install it from [python.org/downloads](https://www.python.org/downloads/) — on Windows, tick **"Add
Python to PATH"** in the installer.

For those that do not have Python installed and are just getting started, we recommend installing Anaconda. Anaconda is
a Python distribution for scientific computing and so provides everything you need, Python, pip and Jupyter Notebook
along with libraries such as Pandas, Numpy and Matplotlib. Datacamp provide a good tutorial for [installing
Anaconda on Windows](https://www.datacamp.com/tutorial/installing-anaconda-windows) to get started.
Then create an environment and install brightwind:

Once Anaconda is installed, you can use the **Anaconda Prompt** to run the above command line `pip install brightwind`.
Or first use **Anaconda Navigator** to create an environment.
```bash
python -m venv brightwind_env
# Windows
brightwind_env\Scripts\activate
# macOS / Linux
source brightwind_env/bin/activate

---
### Documentation
pip install brightwind
```

Documentation on how to get setup and use the library can be found at https://brightwind-dev.github.io/brightwind-docs/
#### Option 2 — conda

<br>
Common if you already use Anaconda or work primarily in Jupyter.
[Anaconda](https://www.datacamp.com/tutorial/installing-anaconda-windows) bundles Python, pip and Jupyter in one
installer. From the **Anaconda Prompt**:

Example usage of the brightwind library is shown below using Jupyter Notebook. Jupyter Notebook is a powerful way to
immediately see the results of code you have written.
<br>
```bash
conda create --name brightwind_env python=3.11
conda activate brightwind_env
pip install brightwind
```

<p>
A step-by-step Windows install walkthrough is also available in the
[tutorials](https://brightwind-dev.github.io/brightwind-docs/).

![demo_image_1](read_me_1.png)
![demo_image_2](read_me_2.png)
</p>
**Optional — parquet support**

Reading `.parquet` files from BrightHub needs a parquet engine. Install the default (pyarrow):

```bash
pip install brightwind[parquet]
```

Or use fastparquet instead: `pip install brightwind[parquet-fastparquet]`.

<br>

##### Features
The library provides wind analysts with easy to use tools for working with
meteorological data. It supports loading of meteorological data, averaging,
filtering, plotting, correlations, shear analysis, long term adjustments, etc.
The library can then export a resulting long term adjusted tab file to be used in
other wind analysis software.
---
### Quick start

Most analysts use brightwind from a Jupyter Notebook:

```bash
pip install jupyter
jupyter notebook
```

```python
import brightwind as bw

data = bw.load_csv(bw.demo_datasets.demo_data)
bw.basic_stats(data)
```

For full examples — loading, plotting, shear, correlations, exporting — see the
[tutorials and API reference](https://brightwind-dev.github.io/brightwind-docs/).

<br>

##### Benefits
The key benefits to an open-source library is that it provides complete transparency
and traceability. Anyone in the industry can review any part of the code and suggest changes,
thus creating a standardised, validated toolkit for the industry.
<p>

By default, during an assessment every manipulation or adjustment made to the wind data is
contained in a single file. This can easily be reviewed and checked by internal reviewers or,
as the underlying code is open-sourced, there is no reason why this file cannot be sent to
3rd parties for review thus increasing the effectiveness of a banks due diligence.
![demo_image_1](read_me_1.png)
![demo_image_2](read_me_2.png)
</p>

<br>

##### License
The library is licensed under the MIT license.
---
### Why open-source?

The brightwind library is open-source, making every step of an assessment transparent, auditable and reproducible. The full record of
adjustments to a dataset lives in a single file that internal reviewers, third parties and banks can inspect
directly — sharpening due diligence and removing the "black box" problem of proprietary tools.

The intent is a shared, validated toolkit that the wind and solar industry builds on together, rather than each
consultancy reinventing the same calculations behind closed doors.

<br>

---
### Test datasets
A test dataset is included in this repository and is used to demonstrate function and test functions in the code.
Other files and datasets are also included to complement this demo dataset. These are outlined below:

<br>
Demo datasets are bundled with the library to demonstrate functions and exercise the test suite:

| Dataset | Source | Notes |
|:--------------------- |:-------------|:-----|
| demo_data.csv | BrightWind | A modified 2 year met mast dataset in csv and Campbell Scientific format. |
| MERRA-2_XX_2000-01-01_2017-06-30.csv | NASA [GES DISC](https://disc.gsfc.nasa.gov/) | 4 x MERRA-2 18-yr datasets to complement the demo data for long term analyses. |
| demo_cleaning_file.csv | BrightWind | A file containing information on what periods to clean out from the demo data. |
| windographer_flagging_log.txt | BrightWind | The same cleaning info as found in 'demo_cleaning_file.csv' formatted as a Windographer flagging file. |
| demo_data_iea43_wra_data_model.json | BrightWind | A JSON file formatted according to the IEA Wind Task 43 [WRA Data Model](https://github.com/IEA-Task-43/digital_wra_data_standard) standard which describes the mast configuration for the demo data. |
| Dataset | Source | Notes |
|:--- |:--- |:--- |
| `demo_data.csv` | BrightWind | A modified 2-year met mast dataset in CSV and Campbell Scientific format. |
| `MERRA-2_XX_2000-01-01_2017-06-30.csv` | NASA [GES DISC](https://disc.gsfc.nasa.gov/) | 4 × MERRA-2 18-year datasets to complement the demo data for long-term analyses. |
| `demo_cleaning_file.csv` | BrightWind | Periods to clean out from the demo data. |
| `windographer_flagging_log.txt` | BrightWind | Same cleaning info as `demo_cleaning_file.csv` formatted as a Windographer flagging file. |
| `demo_data_iea43_wra_data_model.json` | BrightWind | A JSON file formatted to the IEA Wind Task 43 [WRA Data Model](https://github.com/IEA-Task-43/digital_wra_data_standard) standard, describing the mast configuration for the demo data. |

<br>

---
### Contributing
If you wish to be involved or find out more please contact stephen@brightwindanalysis.com.

More information can be found in the [contributing.md](https://github.com/brightwind-dev/brightwind/blob/master/contributing.md) section of the website.
Brightwind welcomes contributions from across the wind and solar industry — analysts, engineers, researchers and
developers.

- **Issues, bugs and feature requests:** [GitHub issue tracker](https://github.com/brightwind-dev/brightwind/issues)
- **Code contributions and development setup:** see [contributing.md](contributing.md)
- **General enquiries:** stephen@brightwindanalysis.com

<br>

---
### License

MIT — see [LICENSE.txt](LICENSE.txt).
2 changes: 1 addition & 1 deletion brightwind/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@

__all__ = ['analyse', 'transform', 'export', 'load', 'demo_datasets']

__version__ = '2.6.0'
__version__ = '2.7.0'
41 changes: 40 additions & 1 deletion brightwind/load/cleaning_rule.schema.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$version": "1.0.0",
"$version": "1.1.0",
"definitions": {
"condition": {
"type": "object",
Expand Down Expand Up @@ -47,6 +47,44 @@
{ "required": ["or"], "maxProperties": 1 },
{ "required": ["not"], "maxProperties": 1 }
]
},
"time_condition": {
"type": "object",
"properties": {
"value": {
"type": "string",
"format": "date-time",
"description": "An ISO 8601 timestamp compared against the timeseries datetime index."
},
"comparison_operator_id": {
"type": "integer",
"oneOf": [
{ "const": 1, "description": "is less than" },
{ "const": 2, "description": "is less than or equal" },
{ "const": 3, "description": "is greater than" },
{ "const": 4, "description": "is greater than or equal" },
{ "const": 5, "description": "equals" },
{ "const": 6, "description": "not equals" }
]
},
"and": {
"type": "array",
"items": { "$ref": "#/definitions/time_condition" },
"minItems": 2
},
"or": {
"type": "array",
"items": { "$ref": "#/definitions/time_condition" },
"minItems": 2
},
"not": { "$ref": "#/definitions/time_condition" }
},
"oneOf": [
{ "required": ["value", "comparison_operator_id"] },
{ "required": ["and"], "maxProperties": 1 },
{ "required": ["or"], "maxProperties": 1 },
{ "required": ["not"], "maxProperties": 1 }
]
}
},
"type": "object",
Expand All @@ -55,6 +93,7 @@
"type": "object",
"properties": {
"conditions": { "$ref": "#/definitions/condition" },
"time_range_conditions": { "$ref": "#/definitions/time_condition" },
"clean_out": {
"type": "array",
"items": {
Expand Down
Loading
Loading