diff options
author | Alexander_Kabui | 2024-05-16 14:21:47 +0300 |
---|---|---|
committer | Alexander_Kabui | 2024-05-16 14:21:47 +0300 |
commit | f911db6b69b16ac5df57b27d213fa88a4c848f50 (patch) | |
tree | 44c698c03fdfe3bf0608bf6d7a3d100df0df4438 /gn3 | |
parent | 75365bd88a720261a1b454f0ea11a840fb3be83e (diff) | |
download | genenetwork3-f911db6b69b16ac5df57b27d213fa88a4c848f50.tar.gz |
Delete response file
* File is obsolete functionality move to process.py file
Diffstat (limited to 'gn3')
-rw-r--r-- | gn3/llms/response.py | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/gn3/llms/response.py b/gn3/llms/response.py deleted file mode 100644 index 2f00312..0000000 --- a/gn3/llms/response.py +++ /dev/null @@ -1,43 +0,0 @@ -""" Module contains code for parsing references doc_ids """ -# pylint: disable=C0301 -import json -import os - -basedir = os.path.abspath(os.path.dirname(__file__)) - - -class DocIDs(): - """ Class Method to Parse document id and names""" - def __init__(self): - """ - init method for Docids - * doc_ids.json: opens doc)ids for gn references - * sugar_doc_ids: open doci_ids for diabetes references - """ - self.doc_ids = self.load_file("doc_ids.json") - self.sugar_doc_ids = self.load_file("all_files.json") - self.format_doc_ids(self.sugar_doc_ids) - - def load_file(self, file_name): - """Method to load and read doc_id files""" - file_path = os.path.join(basedir, file_name) - if os.path.isfile(file_path): - with open(file_path, "rb") as file_handler: - return json.load(file_handler) - else: - raise FileNotFoundError(f"{file_path}-- FIle does not exist\n") - - def format_doc_ids(self, docs): - """method to format doc_ids for list items""" - for _key, val in docs.items(): - if isinstance(val, list): - for doc_obj in val: - doc_name = doc_obj["filename"].removesuffix(".pdf").removesuffix(".txt").replace("_", "") - self.doc_ids.update({doc_obj["id"]: doc_name}) - - def get_info(self, doc_id): - """ interface to make read from doc_ids""" - if doc_id in self.doc_ids.keys(): - return self.doc_ids[doc_id] - else: - return doc_id |