From b7a1f34645e4b2f4317e269fbfc7c80057417172 Mon Sep 17 00:00:00 2001 From: lauraporta Date: Tue, 5 Nov 2024 15:29:29 +0000 Subject: [PATCH] Pre-commit hook modifications --- calcium_imaging_automation/core/reader.py | 4 +++- examples/example_usage.py | 16 ++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/calcium_imaging_automation/core/reader.py b/calcium_imaging_automation/core/reader.py index 400044d..ea77848 100644 --- a/calcium_imaging_automation/core/reader.py +++ b/calcium_imaging_automation/core/reader.py @@ -13,7 +13,9 @@ def __init__( self.folder_read_pattern = folder_read_pattern self.datasets_paths = self.get_folders_first_layer(raw_data_folder) - self.dataset_names = [dataset_path.name for dataset_path in self.datasets_paths] + self.dataset_names = [ + dataset_path.name for dataset_path in self.datasets_paths + ] def get_folders_first_layer(self, file_path: Path) -> List[Path]: return list(file_path.glob(self.folder_read_pattern)) diff --git a/examples/example_usage.py b/examples/example_usage.py index 4b19a1b..3e638ca 100644 --- a/examples/example_usage.py +++ b/examples/example_usage.py @@ -1,6 +1,6 @@ import argparse -from pathlib import Path import logging +from pathlib import Path from calcium_imaging_automation.core.reader import ReadAllPathsInFolder from calcium_imaging_automation.core.writer import DatashuttleWrapper @@ -19,7 +19,7 @@ def main( filename=output_path / "logs" / "pipeline.log", level=logging.INFO, format="%(asctime)s - %(message)s", - ) + ) reader = ReadAllPathsInFolder( raw_data_path, filetypes_of_interest, folder_read_pattern @@ -28,22 +28,26 @@ def main( logging.info(f"Dataset names: {reader.dataset_names}") writer = DatashuttleWrapper(output_path) - + number_of_tiffs = reader.max_session_number(filetype="tif") writer.create_folders(reader.dataset_names, session_number=number_of_tiffs) # [Placeholder for data processing] logging.info("Pipeline finished.") - + if __name__ == "__main__": parser = argparse.ArgumentParser( description="Example usage of the pipeline manager." ) - parser.add_argument("raw_data_path", type=Path, help="Path to the raw data.") - parser.add_argument("output_path", type=Path, help="Path to the output data.") + parser.add_argument( + "raw_data_path", type=Path, help="Path to the raw data." + ) + parser.add_argument( + "output_path", type=Path, help="Path to the output data." + ) parser.add_argument( "--filetypes", type=list,