Skip to content

Commit

Permalink
import accessors from __init__
Browse files Browse the repository at this point in the history
  • Loading branch information
blaylockbk committed Jan 29, 2025
1 parent 4e0d557 commit 995bb81
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
1 change: 1 addition & 0 deletions herbie/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,4 @@ def template(self):
from herbie.fast import FastHerbie
from herbie.latest import HerbieLatest, HerbieWait
from herbie.wgrib2 import wgrib2
from herbie.accessors import HerbieAccessor
12 changes: 1 addition & 11 deletions herbie/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,7 @@
# NOTE: The config dict values are retrieved from __init__ and read
# from the file ${HOME}/.config/herbie/config.toml
# Path is imported from __init__ because it has my custom methods.

try:
# Load custom xarray accessors
import herbie.accessors # noqa: F401
except Exception:
warnings.warn(
"herbie xarray accessors could not be imported."
"Probably missing a dependency like MetPy."
"If you want to use these functions, try"
"`pip install metpy`"
)
# Load custom xarray accessors

log = logging.getLogger(__name__)

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ dependencies = [
"cfgrib>=0.9.15",
"numpy>=2.2.1",
"pandas>=2.2.3",
"pyproj>=3.7.0",
"requests>=2.23.3",
"toml>=0.10.2", # TODO: Drop in favor of tomllib when Python >=3.11 is required.
"xarray>=2025.1.1",
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ matplotlib
metpy
numpy
pandas
pyproj
pygrib
scikit-learn
toml
Expand Down

0 comments on commit 995bb81

Please sign in to comment.