Skip to content

Commit

Permalink
WIP on filename
Browse files Browse the repository at this point in the history
  • Loading branch information
lauraporta committed Nov 5, 2024
1 parent e11b2e2 commit e85206c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
2 changes: 2 additions & 0 deletions calcium_imaging_automation/core/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ def __init__(
raw_data_folder: Path,
filetypes_of_interest: List[str],
folder_read_pattern: str,
file_read_pattern: str,
):
self.filetypes_of_interest = filetypes_of_interest
self.folder_read_pattern = folder_read_pattern
self.file_read_pattern = file_read_pattern

self.datasets_paths = self.get_folders_first_layer(raw_data_folder)
self.dataset_names = [
Expand Down
21 changes: 19 additions & 2 deletions examples/example_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def main(
output_path: Path,
filetypes_of_interest: list,
folder_read_pattern: str,
file_read_pattern: str,
):
"""
Draft usage of the pipeline, now consisting of read and write operations.
Expand All @@ -23,7 +24,10 @@ def main(
)

reader = ReadAllPathsInFolder(
raw_data_path, filetypes_of_interest, folder_read_pattern
raw_data_path,
filetypes_of_interest,
folder_read_pattern,
file_read_pattern,
)
logging.info(f"Found {len(reader.datasets_paths)} datasets.")
logging.info(f"Dataset names: {reader.dataset_names}")
Expand Down Expand Up @@ -59,6 +63,12 @@ def main(
parser.add_argument(
"--folder_read_pattern",
type=str,
help="Glob pattern for reading folder.",
default="*",
)
parser.add_argument(
"--file_read_pattern",
type=str,
help="Glob pattern for reading files.",
default="*",
)
Expand All @@ -68,5 +78,12 @@ def main(
output_path = args.output_path
file_types = args.filetypes
folder_read_pattern = args.folder_read_pattern
file_read_pattern = args.file_read_pattern

main(raw_data_path, output_path, file_types, folder_read_pattern)
main(
raw_data_path,
output_path,
file_types,
folder_read_pattern,
file_read_pattern,
)

0 comments on commit e85206c

Please sign in to comment.