|
| 1 | +# New Herbie |
| 2 | + |
| 3 | +New Dependencies |
| 4 | + |
| 5 | +- Polars: I much prefer using this DataFrame library over Pandas. |
| 6 | +- Rich: For printing information for the user in a fancy way. |
| 7 | + |
| 8 | +The default save directory is now `~/herbie-data/` |
| 9 | + |
| 10 | +```python |
| 11 | +from herbie.v2 import Herbie |
| 12 | +``` |
| 13 | + |
| 14 | +Herbie is now a namespace, with many model HerbieModel classes for different models. |
| 15 | + |
| 16 | +```python |
| 17 | +H = Herbie.HRRR('2025-01-01') |
| 18 | +``` |
| 19 | + |
| 20 | +you may also just import the model you want to use instead |
| 21 | + |
| 22 | +```python |
| 23 | +from herbie.v2 import HRRR |
| 24 | +H = HRRR('2025-01-01') |
| 25 | +``` |
| 26 | + |
| 27 | +## `fxx` is now `step` |
| 28 | + |
| 29 | +The forecast lead time is now controlled with the step parameter, and may be a timedelta object (which is converted to integer hours). The following are equivalent: |
| 30 | + |
| 31 | +```python |
| 32 | +from herbie.v2 import Herbie |
| 33 | +from datetime import datetime, timedelta |
| 34 | + |
| 35 | +H = Herbie.HRRR('2025-01-01', step=12) |
| 36 | + |
| 37 | +H = Herbie.HRRR(datetime(2025,1,1), step=timedelta(hours=12)) |
| 38 | +``` |
| 39 | + |
| 40 | +## Notebook HTML Representor |
| 41 | + |
| 42 | +For convenient user exploration, when displaying a Herbie object in a Jupyter Notebook, there is a new HTML display showing the parameters selected and sources. |
| 43 | + |
| 44 | +## Model Templates |
| 45 | + |
| 46 | +Big change to the model templates. These are subclassed from the base class HerbieModel. |
| 47 | + |
| 48 | +## Inventory |
| 49 | + |
| 50 | +Use Polars as the DataFrame. I'm a big Polars fan, and find it much easier to read and write than Pandas. |
| 51 | + |
| 52 | +Since I'm using Polars for the DataFrame, users can filter the inventory with expressions for each column rather than just the "search_this" column. |
| 53 | + |
| 54 | +The data and index source are now included in the inventory dataframe. This will enable downloading fields from multiple files and "build your own GRIB files." |
| 55 | + |
| 56 | +## Download |
| 57 | + |
| 58 | +Download for subsets are now done with multiple threads, one thread for each subset group. |
| 59 | + |
| 60 | +Use rich progress bars for downloads. |
| 61 | + |
| 62 | +Remote file paths are preserved rather than specifying a custom data path. I wanted to make it possible to use rclone to quickly pre-fill your `herbie-data/` directory, then use Herbie to access those files locally. |
| 63 | + |
| 64 | +## xarray |
| 65 | + |
| 66 | +Multiple hypercubes are returned as a DataTree. |
| 67 | + |
| 68 | +## status |
| 69 | + |
| 70 | +Display the sources and which sources have been checked and if the files exist. |
| 71 | + |
| 72 | +## resolve |
| 73 | + |
| 74 | +Manually check if files exist |
| 75 | + |
| 76 | +```python |
| 77 | +# Find first available file |
| 78 | +H.resolve() |
| 79 | + |
| 80 | +# Check specific source |
| 81 | +H.resolve('google') |
| 82 | + |
| 83 | +# Check all |
| 84 | +H.resolve('all') |
| 85 | +``` |
| 86 | + |
| 87 | +## FastHerbie |
| 88 | + |
| 89 | +This behaves _very_ different. Inventory DataFrames are concatted together for many files, then parallel downloads happen and join the fields into a new, custom grib file. It's a "build your own GRIB" feature. |
| 90 | + |
| 91 | +Examples: |
| 92 | + |
| 93 | +- Get all 6-hr `TMP:2 m` forecasts for the day in one file. |
| 94 | +- Get all `GRD:10 m` forecasts initialized at a single time. |
0 commit comments