Load package from provided path.
Parameters:
Returns:
Source code in model_navigator/package/__init__.py
| def load(
path: Union[str, pathlib.Path],
workspace: Optional[Union[str, pathlib.Path]] = None,
) -> Package:
"""Load package from provided path.
Args:
path: The location of package to load
workspace: Workspace where packages will be extracted
Returns:
Package.
"""
LOGGER.info(f"Loading package from {path} to {workspace}.")
workspace = Workspace(workspace)
workspace.initialize()
loader = PackageLoader()
package = loader.from_file(path=path, workspace=workspace)
LOGGER.info(f"Package loaded and unpacked {workspace}.")
return package
|