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
20 changes: 10 additions & 10 deletions src/herbie/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,16 +223,6 @@ def __init__(
# (see https://stackoverflow.com/a/7936588/2383070 for what I'm doing here)
getattr(model_templates, self.model).template(self)

if product is None:
# The user didn't specify a product, so let's use the first
# product in the model template.
self.product = list(self.PRODUCTS)[0]
log.info(f'`product` not specified. Will use "{self.product}".')
# We need to rerun this so the sources have the new product value.
getattr(model_templates, self.model).template(self)

self.product_description = self.PRODUCTS[self.product]

# Specify the suffix for the inventory index files.
# Default value is `.grib2.idx`, but some have weird suffix,
# like archived RAP on NCEI are `.grb2.inv`.
Expand All @@ -246,9 +236,19 @@ def __init__(

self.search_help = _search_help(self.IDX_STYLE)

if product is None:
# The user didn't specify a product, so let's use the first
# product in the model template.
self.product = list(self.PRODUCTS)[0]
log.info(f'`product` not specified. Will use "{self.product}".')
# We need to rerun this so the sources have the new product value.
getattr(model_templates, self.model).template(self)

# Check the user input
self._validate()

self.product_description = self.PRODUCTS[self.product]

# Ok, now we are ready to look for the GRIB2 file at each of the remote sources.
# self.grib is the first existing GRIB2 file discovered.
# self.idx is the first existing index file discovered.
Expand Down
Loading