A toolkit for WeatherBench based on PyTorch
pip install wxbtool
For detailed installation instructions, see the Installation Guide.
wxb data-serve -m wxbtool.specs.res5_625.t850weyn -s Setting3d
wxb train -m wxbtool.zoo.res5_625.unet.t850d3sm_weyn
wxb test -m wxbtool.zoo.res5_625.unet.t850d3sm_weyn
wxb forecast -m wxbtool.zoo.res5_625.unet.t850d3sm_weyn -t 2023-01-01 -o output.png
Note: For deterministic forecast, -t must be in YYYY-MM-DD (date only).
wxb forecast -m wxbtool.zoo.res5_625.unet.t850d3sm_weyn -t 2023-01-01T00:00:00 -G true -s 10 -o output.nc
Note: For GAN forecast, -t must be in YYYY-MM-DDTHH:MM:SS (date and time).
wxb data-serve -m wxbtool.specs.res5_625.t850weyn -s Setting3d -b 0.0.0.0:8088
Note: Use --bind to specify the address. The --port option is currently not used by the implementation.
wxb train -m wxbtool.zoo.res5_625.unet.t850d3sm_weyn -d unix:/tmp/test.sock
wxb backtest -m wxbtool.zoo.res5_625.unet.t850d3sm_weyn -t 2023-01-01 -o output.nc
This will write outputs under output/2023-01-01/ and, when using .nc, also create var_day_rmse.json containing day-by-day RMSE.
wxb data-download -m wxbtool.zoo.res5_625.unet.t850d3sm_weyn --coverage weekly
For more detailed examples and explanations, see the Quick Start Guide.
wxbtool supports flexible dataset layouts beyond the default yearly files. You can configure how data files are discovered by setting two fields in your Setting:
- granularity: one of yearly, quarterly, monthly, weekly, daily, hourly
- data_path_format: a Python format string relative to the variable directory, supporting placeholders {var}, {resolution}, {year}, {month}, {day}, {hour}, {week}, {quarter}
Example for monthly files:
from wxbtool.nn.setting import Setting
class MySetting(Setting):
def __init__(self):
super().__init__()
self.granularity = "monthly"
self.data_path_format = "{year}/{var}_{year}-{month:02d}_{resolution}.nc"
See details and more examples in the Data Handling Guide.
- Installation Guide
- Quick Start Guide
- Data Handling Guide
- Training Guide
- Evaluation Guide
- Inference Guide
- Troubleshooting Guide
See the comprehensive documentation in the docs directory.
uv build
uv publish
git tag va.b.c master
git push origin va.b.c
- Mingli Yuan (Mountain)
- Ren Lu