-
Notifications
You must be signed in to change notification settings - Fork 218
Open
Labels
Description
Motivations:
- Sometimes modules are getting imported several times through lazy import
- Not easy to manage dependencies from file to file
This is how we are managing dependencies now
# current state of lazy import
def lazy_umap_import_has_dependancy():
try:
import warnings
warnings.filterwarnings("ignore")
import umap # noqa
return True, "ok", umap
except ModuleNotFoundError as e:
return False, e, NoneAfter dependency manager it will look like
deps = DepManager()
cuml, has_cuml = deps.cuml
umap, has_umap = deps.umapAim
- provides readability, smart dependency management
- easy to write unit tests,
- it will only import the packages once
working example
dcolinmorganlmeyerov
