diff --git a/cgatcore/pipeline/__init__.py b/cgatcore/pipeline/__init__.py index 14f98709..a75d3db2 100644 --- a/cgatcore/pipeline/__init__.py +++ b/cgatcore/pipeline/__init__.py @@ -156,7 +156,6 @@ def loadData(infile, outfile): # cgatcore/pipeline/__init__.py - # Import existing pipeline functionality from cgatcore.pipeline.control import * from cgatcore.pipeline.database import * diff --git a/cgatcore/remote/abstract.py b/cgatcore/remote/abstract.py index 877d053b..3ca847c0 100644 --- a/cgatcore/remote/abstract.py +++ b/cgatcore/remote/abstract.py @@ -26,4 +26,4 @@ def upload(self): @abstractmethod def delete_file(self): - pass \ No newline at end of file + pass diff --git a/cgatcore/remote/file_handler.py b/cgatcore/remote/file_handler.py index 629b63aa..3b22080b 100644 --- a/cgatcore/remote/file_handler.py +++ b/cgatcore/remote/file_handler.py @@ -5,6 +5,7 @@ from functools import wraps from .aws import S3RemoteObject + def s3_path_to_local(s3_path, temp_dir='/tmp'): # Function remains the same parts = s3_path[5:].split('/', 1) @@ -13,6 +14,7 @@ def s3_path_to_local(s3_path, temp_dir='/tmp'): bucket, key = parts return os.path.join(temp_dir, key) + class S3Pipeline: def __init__(self, name=None, temp_dir='/tmp'): self.name = name @@ -167,6 +169,7 @@ def run(self): for task in self.tasks: task() + def suffix(suffix_string): """ Generates a filter function that appends a suffix to a given file path. @@ -182,6 +185,7 @@ def filter_func(input_path): return f"{base}{suffix_string}{ext}" return filter_func + class S3Mapper: """ A mapper class for handling S3 operations. @@ -193,5 +197,5 @@ def __init__(self): """ self.s3 = S3RemoteObject() -# Make sure to export all the functions and classes you want to be accessible + __all__ = ['S3Pipeline', 'S3Mapper', 's3_path_to_local', 'suffix'] diff --git a/tests/mocks.py b/tests/mocks.py index d4c7df26..e8b059ff 100644 --- a/tests/mocks.py +++ b/tests/mocks.py @@ -2,6 +2,7 @@ import os + class MockS3RemoteObject: def __init__(self, *args, **kwargs): self.storage = {}