diff --git a/cognee/config.py b/cognee/config.py index a0b28aa88..0f98db016 100644 --- a/cognee/config.py +++ b/cognee/config.py @@ -35,6 +35,7 @@ class Config: system_root_directory = get_absolute_path(".cognee_system") + logging.info("system_root_directory: %s", system_root_directory) data_root_directory = os.getenv("DATA_PATH", get_absolute_path(".data")) vectordb: str = os.getenv("VECTORDB", "weaviate") diff --git a/cognee/root_dir.py b/cognee/root_dir.py index fa5168881..ae2343d99 100644 --- a/cognee/root_dir.py +++ b/cognee/root_dir.py @@ -1,6 +1,11 @@ from os import path - +import logging ROOT_DIR = path.dirname(path.abspath(__file__)) +logging.debug("ROOT_DIR: ", ROOT_DIR) + def get_absolute_path(path_from_root: str) -> str: + logging.debug("abspath: ", path.abspath(path.join(ROOT_DIR, path_from_root))) + + return path.abspath(path.join(ROOT_DIR, path_from_root)) diff --git a/cognee/tests/test_library.py b/cognee/tests/test_library.py index 3554a7626..336b015bd 100755 --- a/cognee/tests/test_library.py +++ b/cognee/tests/test_library.py @@ -3,14 +3,14 @@ async def main(): import pathlib import cognee - # print("Working dir: ", str(pathlib.Path(__file__).parent)) - # data_directory_path = str(pathlib.Path(path.join(pathlib.Path(__file__).parent, "../../.data")).resolve()) - # print("Data dir: ", data_directory_path) - # cognee.config.data_root_directory(data_directory_path) - # - # cognee_directory_path = str(pathlib.Path(path.join(pathlib.Path(__file__).parent, "../../.cognee_system")).resolve()) - # print("System dir: ", cognee_directory_path) - # cognee.config.system_root_directory(cognee_directory_path) + print("Working dir: ", str(pathlib.Path(__file__).parent)) + data_directory_path = str(pathlib.Path(path.join(pathlib.Path(__file__).parent, "../../.data")).resolve()) + print("Data dir: ", data_directory_path) + cognee.config.data_root_directory(data_directory_path) + + cognee_directory_path = str(pathlib.Path(path.join(pathlib.Path(__file__).parent, "../../.cognee_system")).resolve()) + print("System dir: ", cognee_directory_path) + cognee.config.system_root_directory(cognee_directory_path) dataset_name = "cs_explanations"