Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Refactor handling of index files and Inventory #261

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

blaylockbk
Copy link
Owner

The goal of this PR is to refactor the handling of the GRIB index files. This introduces a new Inventory class that is used to check if the index file exits, read the index file into a Pandas DataFrame, and filter the inventory using a searchString which is used for downloading file subsets. The only input to this class is the local or remote path to the index file.

from herbie.inventory import Inventory

I = Inventory("https://noaa-hrrr-bdp-pds.s3.amazonaws.com/hrrr.20231201/conus/hrrr.t00z.wrfsfcf00.grib2.idx")

# All the data in the index file
df = I.dataframe

# A subset of the GRIB messages
df_subset = I.filter("UGRD|VGRD")

This should make working with index files a little more maintainable and debugable.

  • Write sufficient tests.
  • Test for all model types.
  • Implement in the Herbie class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant