Skip to content

Commit

Permalink
Pre-commit hook modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
lauraporta committed Nov 5, 2024
1 parent 98ac2b5 commit b7a1f34
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
4 changes: 3 additions & 1 deletion calcium_imaging_automation/core/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
16 changes: 10 additions & 6 deletions examples/example_usage.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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,
Expand Down

0 comments on commit b7a1f34

Please sign in to comment.