From 513ea146d29592d8e7c9af7b3e5350fa1007c5e1 Mon Sep 17 00:00:00 2001 From: Gabe Fierro Date: Tue, 2 Jul 2024 17:25:40 -0600 Subject: [PATCH] do the same filter in utils --- buildingmotif/utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/buildingmotif/utils.py b/buildingmotif/utils.py index 64573623..8a1bdbcc 100644 --- a/buildingmotif/utils.py +++ b/buildingmotif/utils.py @@ -185,7 +185,12 @@ def get_ontology_files(directory: Path, recursive: bool = True) -> List[Path]: searches = (directory.rglob(f"{pat}") for pat in patterns) else: searches = (directory.glob(f"{pat}") for pat in patterns) - return list(chain.from_iterable(searches)) + # filter out files in .ipynb_checkpoints + filtered_searches = ( + filter(lambda x: ".ipynb_checkpoints" not in Path(x).parts, search) + for search in searches + ) + return list(chain.from_iterable(filtered_searches)) def get_template_parts_from_shape(