Metadata-Version: 2.4
Name: extremeweatherbench
Version: 1.0.0
Summary: Benchmarking weather and weather AI models using extreme events
Project-URL: Documentation, https://extremeweatherbench.readthedocs.io/
Project-URL: Repository, https://github.com/brightbandtech/extremeweatherbench
License: MIT License
        
        Copyright (c) 2025 Brightband
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: benchmarking,climate,extreme events,forecasting,weather
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
Requires-Python: <3.14,>=3.11
Requires-Dist: cartopy==0.24.1
Requires-Dist: click>=8.1.8
Requires-Dist: dacite>=1.8.1
Requires-Dist: eccodes==2.42.0
Requires-Dist: flox>=0.10.0
Requires-Dist: frozenlist==1.5.0
Requires-Dist: gcsfs>=2024.12.0
Requires-Dist: geopandas>=1.0.1
Requires-Dist: joblib>=1.4.2
Requires-Dist: kerchunk[dev]
Requires-Dist: numba>=0.63.1
Requires-Dist: numpy>=2.2.0
Requires-Dist: pandas>=2.2.3
Requires-Dist: polars>=1.32.1
Requires-Dist: pyarrow>=19.0.1
Requires-Dist: pyogrio==0.10.0
Requires-Dist: pyyaml>=6.0.2
Requires-Dist: regionmask>=0.13.0
Requires-Dist: s3fs>=2024.12.0
Requires-Dist: scikit-image>=0.25.2
Requires-Dist: scores>=2.4.0
Requires-Dist: sparse>=0.17.0
Requires-Dist: tqdm>=4.67.1
Requires-Dist: xarray[io]>=2025.7.1
Requires-Dist: zarr<4,>=3.0.9
Provides-Extra: data-prep
Requires-Dist: fsspec>=2024.12.0; extra == 'data-prep'
Requires-Dist: icechunk>=1.1.14; extra == 'data-prep'
Requires-Dist: matplotlib>=3.10.0; extra == 'data-prep'
Requires-Dist: obstore>=0.8.2; extra == 'data-prep'
Requires-Dist: scipy>=1.13; extra == 'data-prep'
Requires-Dist: seaborn>=0.13.2; extra == 'data-prep'
Requires-Dist: ujson>=5.10.0; extra == 'data-prep'
Requires-Dist: virtualizarr==2.1.2; extra == 'data-prep'
Provides-Extra: multiprocessing
Requires-Dist: dask[complete]>=2025.1.0; extra == 'multiprocessing'
Requires-Dist: distributed>=2025.1.0; extra == 'multiprocessing'
Description-Content-Type: text/markdown

# Extreme Weather Bench (EWB)

[![Documentation Status](https://readthedocs.org/projects/extremeweatherbench/badge/?version=latest)](https://extremeweatherbench.readthedocs.io/en/latest/?badge=latest)

**EWB is currently in limited pre-release. Bugs are likely to occur for now.**

**v1.0 to be published alongside EWB preprint.**

[Read our blog post here](https://www.brightband.com/blog/extreme-weather-bench)

As AI weather models are growing in popularity, we need a standardized set of community driven tests that evaluate the models across a wide variety of high-impact hazards. Extreme Weather Bench (EWB) builds on the successful work of WeatherBench and introduces a set of high-impact weather events, spanning across multiple spatial and temporal scales and different parts of the weather spectrum. We provide data to use for testing, standard metrics for evaluation by forecasters worldwide for each of the phenomena, as well as impact-based metrics. EWB is a community system and will be adding additional phenomena, test cases and metrics in collaboration with the worldwide weather and forecast verification community.

# Events
EWB has cases broken down by multiple event types within `src/extremeweatherbench/data/events.yaml` between 2020 and 2024. EWB case studies are documented [here](docs/events/AllCaseStudies.md).  

## Available: 

| Event Type | Number of Cases |
| ---------- | --------------- | 
| 🌇 Heat Waves | 46 |
| 🧊 Freezes | 14 |
| 🌀 Tropical Cyclones | 106 |
| ☔️ Atmospheric Rivers | 56 |
| 🌪️ Severe Convection | 115 | 
| **Total Cases** | 337 |

# EWB paper and talks

* AMS 2025 talk: https://ams.confex.com/ams/105ANNUAL/meetingapp.cgi/Paper/451220
* EWB paper is in preparation and will be submitted in late 2025

# How do I suggest new data, metrics, or otherwise get involved?

We welcome your involvement!  The success of a benchmark suite rests on community involvement and feedback. There are several ways to get involved:

* Get involved in community discussion using the discussion board
* Submit new code requests using the issues
* Send us email at hello@brightband.com 

# Installing EWB

Currently, the easiest way to install EWB is using the ```pip``` command:

```shell
$ pip install git+https://github.com/brightbandtech/ExtremeWeatherBench.git
```

It is highly recommend to use [uv](https://docs.astral.sh/uv/) if possible:

```shell
$ git clone https://github.com/brightbandtech/ExtremeWeatherBench.git
$ cd ExtremeWeatherBench
$ uv sync
```
# How to Run EWB

Running EWB on sample data (included) is straightforward. 

## Using command line initialization:

```shell
$ ewb --default
```
**Note**: this will run every event type, case, target source, and metric for the individual event type as they become available for GFS initialized FourCastNetv2. It is expected a full evaluation will take some time, even on a large VM.
## Using Jupyter Notebook or a Script:
 
```python
from extremeweatherbench import cases, inputs, metrics, evaluate, utils

# Load in a forecast; here, we load in GFS initialized FCNv2 from the CIRA MLWP archive with a default variable built-in for convenience
fcnv2_heatwave_forecast = defaults.cira_fcnv2_heatwave_forecast

# Load in ERA5 with another default convenience variable 
era5_heatwave_target = defaults.era5_heatwave_target

# EvaluationObjects are used to evaluate a single forecast source against a single target source with a defined event type. Event types are declared with each case. One or more metrics can be evaluated with each EvaluationObject.
heatwave_evaluation_list = [
    inputs.EvaluationObject(
        event_type="heat_wave",
        metric_list=[
            metrics.MaximumMeanAbsoluteError(),
            metrics.RootMeanSquaredError(),
            metrics.MaximumLowestMeanAbsoluteError(),
        ],
        target=era5_heatwave_target,
        forecast=fcnv2_heatwave_forecast,
    ),
]
# Load in the EWB default list of event cases
case_metadata = cases.load_ewb_events_yaml_into_case_list()

# Create the evaluation class, with cases and evaluation objects declared
ewb_instance = evaluate.ExtremeWeatherBench(
    case_metadata=case_metadata,
    evaluation_objects=heatwave_evaluation_list,
)

# Execute a parallel run and return the evaluation results as a pandas DataFrame
heatwave_outputs = ewb_instance.run(
    parallel_config={'n_jobs':16} # Uses 16 jobs with the loky backend as default
)

# Save the results
heatwave_outputs.to_csv('heatwave_evaluation_results.csv')
```
