gustaf.helpers.raise_if.ModuleImportRaiser#

class gustaf.helpers.raise_if.ModuleImportRaiser(lib_name: str, error_message: str | None = None)[source]#

Bases: object

Mock imports optional modules if they are not installed.

Class used to have better import error handling in the case that a package package is not installed. This is necessary due to that some packages are not a dependency of gustaf, but some parts require them to function. Examples are splinepy and vedo.

Methods