Herbie v2 API (Major refactor/rewrite) - #504
Open
blaylockbk wants to merge 88 commits into
Open
Conversation
…erbie anymore. Add preliminary GFS template.
…rs-inventory-file-and-core-refactor
Owner
Author
|
Some very basic downloa benchmarks herbie.v2$ uv run download_timer_v2.py
Download Summary:
model='hrrr', date=datetime.date(2026, 5, 4), search='TMP:'
google █ 1.781 s (7 fields, 5.27 MB)
nomads █ 1.782 s (7 fields, 5.27 MB)
pando2 ██▌ 1.965 s (7 fields, 5.27 MB)
pando ████████████████ 3.287 s (7 fields, 5.27 MB)
azure ██████████████████ 3.458 s (7 fields, 5.27 MB)
aws ██████████████████████████████ 4.639 s (7 fields, 5.27 MB)herbie (legacy)$ uv run download_timer.py
Download Summary:
model='hrrr', date=datetime.date(2026, 5, 4), search=':TMP:'
nomads █ 1.769 s (7 fields, 5.27 MB)
google ████▌ 2.671 s (7 fields, 5.27 MB)
pando2 ███████ 3.168 s (7 fields, 5.27 MB)
pando ██████████ 3.919 s (7 fields, 5.27 MB)
aws ████████████████████████▌ 7.242 s (7 fields, 5.27 MB)
azure ██████████████████████████████ 8.413 s (7 fields, 5.27 MB)The Version 2 parallel downloads are a bit faster. |
…e field is given per file
This was referenced May 8, 2026
blaylockbk
marked this pull request as ready for review
June 11, 2026 05:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've learned a thing or two about Python since I started Herbie. I am also learning how to use Claude, which has helped me experiment with and implement some of my ideas a lot faster than I can code by hand.
In this branch I'm trying out some new ideas to better organize Herbie, make it easier to maintain, perform better, and be more ergonomic to the user. It's still a work in progress. Let's consider this PR a preview of things to come.
I'm building the v2 API as an opt-in feature. You can keep using the classic Herbie API the same you did before, but you can also use the new v2 API. I expect that over time the v2 API will become the preferred API as more models are added and refined, while continued development for the classic API will reduce until it's not used anymore.
Install
Usage
You may also import model classes directly
fxxis renamedstep.resolve(),.download(),.inventory(), or.xarray()is used..latest(valid_time=None, step=None, source='aws', **kwargs, max_tdelta=timedelta(days=1)as a HerbieModel class method which locates the latest available dataset from the specified list of sources. Loops through datetimes backwards from requested valid_time until at known initialization increment until one is found.Zarr datasets
While Herbie has been mainly focused on getting data from GRIB sources, I'd like to extend this to access other datasets, like Zarr. I'm thinking of using a class method to target Zarr archives...