import importlib


_lazy_modules = [
    "simnibs_io",
    "utils",
    "quality_measures",
    "rotations"
]


def __getattr__(name):
    """
    Lazy-load selected submodules when accessed as attributes of pynibs.util.
    """
    if name in _lazy_modules:
        mod = importlib.import_module(f".{name}", __name__)
        globals()[name] = mod  # cache for future accesses
        return mod
    raise AttributeError(f"module {__name__!r} has no attribute {name!r}")