-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Speed up CLI execution by lazy importing xarray and cfgrib
- Loading branch information
Showing
6 changed files
with
469 additions
and
479 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from __future__ import annotations | ||
|
||
import functools | ||
import importlib | ||
import types | ||
|
||
|
||
@functools.cache | ||
def import_xarray() -> types.ModuleType: | ||
xarray = importlib.import_module("xarray") | ||
return xarray |
Oops, something went wrong.