Skip to content
Merged
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
66 changes: 37 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@

[![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).
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:

Expand All @@ -26,8 +22,9 @@ EWB has cases broken down by multiple event types within `src/extremeweatherbenc

# 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
* AMS 2025 talk: [1](https://ams.confex.com/ams/105ANNUAL/meetingapp.cgi/Paper/451220)
* AMS 2026 talks: [1](https://ams.confex.com/ams/106ANNUAL/meetingapp.cgi/Paper/477140), [2](https://ams.confex.com/ams/106ANNUAL/meetingapp.cgi/Paper/477141)
* EWB paper is in preparation to be released soon

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

Expand All @@ -39,67 +36,78 @@ We welcome your involvement! The success of a benchmark suite rests on communit

# Installing EWB

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

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

# Or, add to an existing uv virtual environment
$ uv add extremeweatherbench
```

It is highly recommend to use [uv](https://docs.astral.sh/uv/) if possible:
If you'd like to install the most recent updates to EWB:

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

Running EWB on sample data (included) is straightforward.

## Using command line initialization:
For extra installation options:

```shell
$ ewb --default
# For running the data prep modules:
$ pip install "extremeweatherbench[data-prep]"
$ uv add "extremeweatherbench[data-prep]"
```
**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.

# How to Run EWB

Running EWB on sample data (included) is straightforward.

## Using Jupyter Notebook or a Script:

```python
from extremeweatherbench import cases, inputs, metrics, evaluate, utils
import extremeweatherbench as ewb

# 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
fcnv2_heatwave_forecast = ewb.defaults.cira_fcnv2_heatwave_forecast

# Load in ERA5 with another default convenience variable
era5_heatwave_target = defaults.era5_heatwave_target
era5_heatwave_target = ewb.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(
ewb.inputs.EvaluationObject(
event_type="heat_wave",
metric_list=[
metrics.MaximumMeanAbsoluteError(),
metrics.RootMeanSquaredError(),
metrics.MaximumLowestMeanAbsoluteError(),
ewb.metrics.MaximumMeanAbsoluteError(),
ewb.metrics.RootMeanSquaredError(),
ewb.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()
case_metadata = ewb.cases.load_ewb_events_yaml_into_case_list()

# Create the evaluation class, with cases and evaluation objects declared
ewb_instance = evaluate.ExtremeWeatherBench(
ewb_instance = ewb.evaluation(
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(
heatwave_outputs = ewb_instance.run_evaluation(
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')
```

## 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.
Loading