13 This package encapsulates different PXD background generator models.
16 from importlib
import import_module
17 from typing
import Callable, 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"
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"
Type _get_model_cls(str model)
Helper function that imports and returns the class Model from the Python module named as model and as...
Callable _get_generate_func(str model)
Helper function that imports and returns the function generate from the Python module named as model ...