From 998e8564bda2ff7af29ed6723e508af354d648b9 Mon Sep 17 00:00:00 2001 From: Sam Cox Date: Tue, 27 Feb 2024 10:06:15 -0800 Subject: [PATCH] removed unused function --- mdagent/utils/__init__.py | 3 +-- mdagent/utils/general_utils.py | 24 ------------------------ 2 files changed, 1 insertion(+), 26 deletions(-) delete mode 100644 mdagent/utils/general_utils.py diff --git a/mdagent/utils/__init__.py b/mdagent/utils/__init__.py index ad59b1e4..ef0fa47b 100644 --- a/mdagent/utils/__init__.py +++ b/mdagent/utils/__init__.py @@ -1,5 +1,4 @@ -from .general_utils import find_file_path from .makellm import _make_llm from .path_registry import FileType, PathRegistry -__all__ = ["_make_llm", "PathRegistry", "FileType", "find_file_path"] +__all__ = ["_make_llm", "PathRegistry", "FileType"] diff --git a/mdagent/utils/general_utils.py b/mdagent/utils/general_utils.py deleted file mode 100644 index 6a1a6652..00000000 --- a/mdagent/utils/general_utils.py +++ /dev/null @@ -1,24 +0,0 @@ -import os - - -def find_file_path(file_name: str, exact_match: bool = True): - """get the path of a file, if it exists in repo""" - setup_dir = None - for dirpath, dirnames, filenames in os.walk("."): - if "setup.py" in filenames: - setup_dir = dirpath - break - - if setup_dir is None: - raise FileNotFoundError("Unable to find root directory.") - - for dirpath, dirnames, filenames in os.walk(setup_dir): - for filename in filenames: - if (exact_match and filename == file_name) or ( - not exact_match and file_name in filename - ): - path_full = os.path.join(dirpath, filename) - # make sure its absolute - return os.path.abspath(path_full) - - return None