import_extension_from_path#
- scikitplot.cython.import_extension_from_path(artifact_path, *, module_name=None, key=None, build_dir=None)[source]#
Import an extension module from a filesystem path.
- Parameters:
- artifact_pathpath-like
Path to a compiled extension artifact (
.so/.pyd).- module_namestr or None, default=None
Module name the artifact was compiled for. If None, this function will attempt to read
meta.jsonnear the artifact to obtain the authoritative name (strict). For package builds, this may bemeta.jsonone level above the package directory.- keystr or None, default=None
Optional cache key to attach to the loaded module (overrides meta.json).
- build_dirpathlib.Path or None, default=None
Optional build directory to attach to the loaded module (overrides meta.json).
- Returns:
- types.ModuleType
Imported extension module.
- Raises:
- FileNotFoundError
If the artifact does not exist.
- ValueError
If the artifact suffix is invalid or module name cannot be determined.
- ImportError
If the module cannot be loaded.
- Parameters:
- Return type: