diff --git a/_conv_cache/cache__shAfFEN2sdSn.pkl b/_conv_cache/cache__shAfFEN2sdSn.pkl new file mode 100644 index 0000000..e8425f4 Binary files /dev/null and b/_conv_cache/cache__shAfFEN2sdSn.pkl differ diff --git a/pyproject.toml b/pyproject.toml index bac1edf..309dfe7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,6 @@ emoji = "0.6.0" pyyaml = "6.0.1" python-dotenv = "1.0.0" openai = "1.30.4" -<<<<<<< Updated upstream neo4j = "^5.20.0" nltk = "^3.8.1" scikit-learn = "^1.5.0" @@ -39,9 +38,7 @@ pyjwt = "^2.8.0" python-multipart = "^0.0.9" pytest-asyncio = "^0.23.7" textblob = "^0.18.0.post0" -======= tk = "0.1.0" ->>>>>>> Stashed changes [tool.poetry.group.dev.dependencies] pytest = "^7.4.3" diff --git a/topos/services/basic_analytics/token_classifiers.py b/topos/services/basic_analytics/token_classifiers.py index bb33c8e..d67889a 100644 --- a/topos/services/basic_analytics/token_classifiers.py +++ b/topos/services/basic_analytics/token_classifiers.py @@ -7,7 +7,7 @@ from topos.utilities.utils import get_root_directory # Assuming the config.yaml is in ./topos/ relative to setup.py directory -config_path = os.path.join(get_root_directory(), 'topos', 'config.yaml') +config_path = os.path.join(get_root_directory(), 'config.yaml') with open(config_path, 'r') as file: settings = yaml.safe_load(file) diff --git a/topos/utilities/utils.py b/topos/utilities/utils.py index d4e9805..3928b99 100644 --- a/topos/utilities/utils.py +++ b/topos/utilities/utils.py @@ -3,25 +3,19 @@ import os def get_root_directory(): - def find_setup_py_upwards(start_path): - current_path = start_path - while True: - if 'setup.py' in os.listdir(current_path): - return current_path - parent_path = os.path.abspath(os.path.join(current_path, os.pardir)) - if parent_path == current_path: # Reached the root directory - return None - current_path = parent_path - - # Starting from the current directory - current_directory = os.path.abspath('.') - setup_py_dir = find_setup_py_upwards(current_directory) - - if setup_py_dir is None: - raise FileNotFoundError("setup.py not found in the directory tree.") - - return setup_py_dir - + # Get the current file's directory + current_file_directory = os.path.dirname(os.path.abspath(__file__)) + + # Find the first occurrence of "monster" from the right + monster_index = current_file_directory.rfind("topos") + + if monster_index != -1: + # Get the path up to the first "monster" directory + base_monster_directory = current_file_directory[:monster_index + len("topos")] + return base_monster_directory + else: + raise ValueError("The 'topos' directory was not found in the path.") + def parse_json(data): import json return json.loads(data)