-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactored __init__.py s to address import issues
- Loading branch information
Showing
2 changed files
with
35 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,32 @@ | ||
# cgatcore/__init__.py | ||
import importlib | ||
|
||
pipeline = importlib.import_module('cgatcore.pipeline') | ||
remote = importlib.import_module('cgatcore.remote') | ||
class CgatCore: | ||
"""Main class to encapsulate CGAT core functionality.""" | ||
|
||
def __init__(self): | ||
self._pipeline = None | ||
self._remote = None | ||
|
||
@property | ||
def pipeline(self): | ||
"""Lazy load the pipeline module.""" | ||
if self._pipeline is None: | ||
from cgatcore import pipeline | ||
self._pipeline = pipeline | ||
return self._pipeline | ||
|
||
@property | ||
def remote(self): | ||
"""Lazy load the remote module.""" | ||
if self._remote is None: | ||
from cgatcore import remote | ||
self._remote = remote | ||
return self._remote | ||
|
||
|
||
# Create a global instance of the CgatCore class | ||
cgatcore = CgatCore() | ||
|
||
# Expose the pipeline and remote attributes | ||
pipeline = cgatcore.pipeline | ||
remote = cgatcore.remote |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters