13This package encapsulates different PXD background generator models.
16from importlib
import import_module
17from typing
import Callable, Type
31def _get_model_cls(model: str) -> Type:
34 cls = import_module(f
".{model}", __name__).Model
35 except AttributeError
as exc:
36 exc.msg = f
"please define a model class for {model!r}"
38 except ModuleNotFoundError
as exc:
39 exc.msg = f
"the selected model {model!r} is not implemented"
55def _get_generate_func(model: str) -> Callable:
58 func = import_module(f
".{model}", __name__).generate
59 except AttributeError
as exc:
60 exc.msg = f
"please define the generation function for {model!r}"
62 except ModuleNotFoundError
as exc:
63 exc.msg = f
"the selected model {model!r} is not implemented"