Source code for torx.specializations.aug._aug_module_import_m

"""Contains lazy import functionality for aug_sfutils."""
from functools import lru_cache

[docs] @lru_cache(maxsize=1) def import_aug(): """ Import aug_sfutils if installed. Returns ------- module The aug_sfutils module. Raises ------ RuntimeError If aug_sfutils is not installed or not accessible. """ try: import aug_sfutils as sf except ImportError as err: raise RuntimeError( "AUG shotfile reader requires aug_sfutils to be installed. " "aug_sfutils is only available within the IPP network." f"Original error: {err}" ) from err return sf