Skip to content

Commit

Permalink
lazy imports at top level of the module
Browse files Browse the repository at this point in the history
  • Loading branch information
deeenes committed Jul 1, 2024
1 parent fac2841 commit 63db80e
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions networkcommons/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,28 @@
'setup',
'data',
'eval',
'_methods',
'methods',
'noi',
'utils',
'visual',
]

import lazy_import

from ._metadata import __author__, __version__
from ._session import log, _log, session
from ._conf import config, setup

from . import _data as data
from . import _eval as eval
from . import _methods as _methods
from . import _noi as noi
from . import _utils as utils
from . import _visual as visual

_MODULES = [
'data',
'eval',
'methods',
'noi',
'visual',
]

for _mod in _MODULES:

globals()[_mod] = lazy_import.lazy_module(f'{__name__}.{_mod}')

0 comments on commit 63db80e

Please sign in to comment.