Skip to content

Commit

Permalink
Merge pull request #179 from cgat-developers/AC-aws
Browse files Browse the repository at this point in the history
included S3 decorators
  • Loading branch information
Acribbs authored Nov 11, 2024
2 parents b2d768e + be693f9 commit 6328b14
Show file tree
Hide file tree
Showing 15 changed files with 544 additions and 480 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,5 @@ _test_commandline.yaml
# sample workflow
means.txt
sample*

.idea
1 change: 1 addition & 0 deletions all-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ pytest -v tests/test_pipeline_execution.py
pytest -v tests/test_pipeline_cli.py
pytest -v tests/test_pipeline_actions.py
pytest -v tests/test_execution_cleanup.py
pytest -v tests/test_s3_decorators.py
28 changes: 28 additions & 0 deletions cgatcore/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# cgatcore/__init__.py


class CgatCore:
"""Main class to encapsulate CGAT core functionality with lazy loading."""

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

def get_remote(self):
"""Dynamically load and return the remote module when explicitly called."""
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()
2 changes: 1 addition & 1 deletion cgatcore/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,13 +297,13 @@ class method (:func:`cached_method`) calls.
import functools
import gzip
import warnings
import pipes
import optparse
import argparse
import textwrap
import random
import uuid
import yaml
import shlex as pipes # Use shlex as a replacement for pipes
# import convenience functions from logging
import logging
import logging.config
Expand Down
Loading

0 comments on commit 6328b14

Please sign in to comment.