From 117e9b49b5394647dc64cd9dfcaa6819a238623c Mon Sep 17 00:00:00 2001 From: Malte Schokolowski <baw8441@uni-hamburg.de> Date: Thu, 9 Dec 2021 21:09:20 +0100 Subject: [PATCH] added relative paths --- verarbeitung/Processing.py | 121 +----------------- .../__pycache__/Processing.cpython-39.pyc | Bin 7149 -> 7151 bytes verarbeitung/import_from_json.py | 3 +- verarbeitung/print_graph_test.py | 3 +- verarbeitung/update_graph.py | 3 +- 5 files changed, 7 insertions(+), 123 deletions(-) diff --git a/verarbeitung/Processing.py b/verarbeitung/Processing.py index e773708..a3e245a 100644 --- a/verarbeitung/Processing.py +++ b/verarbeitung/Processing.py @@ -18,7 +18,7 @@ import requests as req import sys from pathlib import Path #sys.path.insert(1, 'C:\Users\Malte\Git\CiS-Projekt\ci-s-projekt-verarbeitung\input') -sys.path.append(".") +sys.path.append("../") from input.interface import InputInterface as Input #import input from input_test import input_test_func @@ -27,7 +27,6 @@ from json_demo import output_to_json def initialize_nodes_list(doi_input_list, search_depth_max, search_height_max, test_var): ''' -<<<<<<< HEAD :param doi_input_list: input list of doi from UI :type doi_input_list: list of strings @@ -41,20 +40,6 @@ def initialize_nodes_list(doi_input_list, search_depth_max, search_height_max, t :type test_var: boolean ''' -======= - :param doi_input_list: list with dois from user - :type doi_input_list: list - :param search_depth_max: recursion depth limit - :type search_depth_max: Integer - :param search_height_max: recursion height limit - :type search_height_max: Integer - :param test_var: Wert, um zu entscheiden, ob die Test-Input-Funktion oder die Standartversion gewählt werden soll - :type test_var: Boolscher Wert (True = Test-Funkion, False = Standart-Funktion) - - # adds every publication from input list to graph structure - # doi_input_list: list of publication dois from user - ''' ->>>>>>> 860565e76ef4ea961db9ca1564c95ac12ff9bf46 references_pub_obj_list = [] citations_pub_obj_list = [] @@ -100,7 +85,6 @@ def initialize_nodes_list(doi_input_list, search_depth_max, search_height_max, t def complete_inner_edges(test_var): ''' -<<<<<<< HEAD :param test_var: variable to differenciate between test and url call :type test_var: boolean ''' @@ -127,7 +111,7 @@ def create_graph_structure_references(pub, search_depth, search_depth_max, test_ :type pub: Class Publication :param search_depth: current depth to search for references - :type search_depth_max: int + :type search_depth: int :param search_depth_max: maximum depth to search for references :type search_depth_max: int @@ -136,42 +120,6 @@ def create_graph_structure_references(pub, search_depth, search_depth_max, test_ :type test_var: boolean ''' -======= - :param test_var: Wert, um zu entscheiden, ob die Test-Input-Funktion oder die Standartversion gewählt werden soll - :type test_var: Boolscher Wert (True = Test-Funkion, False = Standart-Funktion) - - # adds edges between citation and reference group - ''' - for node in nodes: #iterates over all nodes in the set of nodes - if (node.group == "depth"): #checks if the node has group depth (=is a reference from a paper) - for citation in node.citations: #iterates over the papers that this paper is cited by - for cit in nodes: #iterates over all nodes in set of nodes - if (citation.doi_url == cit.doi_url and [citation.doi_url, node.doi_url] not in edges): #checks if there is already a related node that is in the set of nodes - edges.append([citation.doi_url, node.doi_url]) # creates an edge between them - if (node.group == "height"): #checks if the node has group height (=is a citation from a paper) - for reference in node.references: #iterates over the papers that this is paper references - for ref in nodes: #iterates over all nodes in set of nodes - if (reference.doi_url == ref.doi_url and [node.doi_url, reference.doi_url] not in edges): #checks if there is already a related node that is in the set of nodes - edges.append([node.doi_url,reference.doi_url]) #creates an edge between them - - - - -def create_graph_structure_references(pub, search_depth, search_depth_max, test_var): - ''' - :param pub: Paper - :type pub: Onbject of class Publication - :param search_depth: current recursion step - :type search_depth: integer - :param search_depth_max: recursion limit - :type search_depth_max: integer - :param test_var: Wert, um zu entscheiden, ob die Test-Input-Funktion oder die Standartversion gewählt werden soll - :type test_var: Boolscher Wert (True = Test-Funkion, False = Standart-Funktion) - # adds a node for every publication unknown - # adds edges for references between publications - # returs a list of nodes - ''' ->>>>>>> 860565e76ef4ea961db9ca1564c95ac12ff9bf46 references_pub_obj_list = [] for reference in pub.references: #iterates over the references of the considered paper not_in_nodes = True #boolean Value to ensure that there will be no dublicates in the set of nodes @@ -205,7 +153,6 @@ def create_graph_structure_references(pub, search_depth, search_depth_max, test_ return references_pub_obj_list -<<<<<<< HEAD # recursive function to implement height-first-search on references # references_pub_obj_list: input list of references as publication objects # search_depth: current search_depth of height-first-search @@ -216,7 +163,7 @@ def process_references_rec(references_pub_obj_list, search_depth, search_depth_m :type references_pub_obj_list: list of objects of type Class Publications :param search_depth: current depth to search for references - :type search_depth_max: int + :type search_depth: int :param search_depth_max: maximum depth to search for references :type search_depth_max: int @@ -225,22 +172,6 @@ def process_references_rec(references_pub_obj_list, search_depth, search_depth_m :type test_var: boolean ''' -======= - -def process_references_rec(references_pub_obj_list, search_depth, search_depth_max, test_var): - ''' - :param references_pub_obj_list: input list of references as publication objects - :type references_pub_obj_list: liste - :param search_depth: current search_depth of height-first-search - :type search_depth: integer - :param search_depth_max: maximal search_depth for dfs - :type search_depth_max: integer - :param test_var: Wert, um zu entscheiden, ob die Test-Input-Funktion oder die Standartversion gewählt werden soll - :type test_var: Boolscher Wert (True = Test-Funkion, False = Standart-Funktion) - - # recursive function to implement height-first-search on references - ''' ->>>>>>> 860565e76ef4ea961db9ca1564c95ac12ff9bf46 # adds next level to nodes/edges for pub in references_pub_obj_list: new_reference_pub_obj_list = create_graph_structure_references(pub, search_depth, search_depth_max, test_var) @@ -255,7 +186,6 @@ def process_references_rec(references_pub_obj_list, search_depth, search_depth_m def create_graph_structure_citations(pub, search_height, search_height_max, test_var): ''' -<<<<<<< HEAD :param pub: publication which citations will be added :type pub: Class Publication @@ -269,20 +199,6 @@ def create_graph_structure_citations(pub, search_height, search_height_max, test :type test_var: boolean ''' -======= - :param pub: Paper - :type pub: Onbject of class Publication - :param search_height: current recursion step - :type search_height: integer - :param search_height_max: recursion limit - :type search_height_max: integer - :param test_var: Wert, um zu entscheiden, ob die Test-Input-Funktion oder die Standartversion gewählt werden soll - :type test_var: Boolscher Wert (True = Test-Funkion, False = Standart-Funktion) - # adds a node for every publication unknown - # adds edges for citations between publications - # returns list of nodes - ''' ->>>>>>> 860565e76ef4ea961db9ca1564c95ac12ff9bf46 citations_pub_obj_list = [] for citation in pub.citations: not_in_nodes = True @@ -316,7 +232,6 @@ def create_graph_structure_citations(pub, search_height, search_height_max, test -<<<<<<< HEAD # recursive function to implement height-first-search on citations # citations_pub_obj_list: input list of citations as publication objects # search_height: current search_height of height-first-search @@ -336,22 +251,6 @@ def process_citations_rec(citations_pub_obj_list, search_height, search_height_m :type test_var: boolean ''' -======= - -def process_citations_rec(citations_pub_obj_list, search_height, search_height_max, test_var): - ''' - :param references_pub_obj_list: input list of citations as publication objects - :type references_pub_obj_list: liste - :param search_height: current search_height of height-first-search - :type search_height: integer - :param search_height_max: maximal search_height for dfs - :type search_height_max: integer - :param test_var: Wert, um zu entscheiden, ob die Test-Input-Funktion oder die Standartversion gewählt werden soll - :type test_var: Boolscher Wert (True = Test-Funkion, False = Standart-Funktion) - - # recursive function to implement height-first-search on citations - ''' ->>>>>>> 860565e76ef4ea961db9ca1564c95ac12ff9bf46 # adds next level to nodes/edges for pub in citations_pub_obj_list: new_citation_pub_obj_list = create_graph_structure_citations(pub, search_height, search_height_max, test_var) @@ -366,7 +265,6 @@ def process_citations_rec(citations_pub_obj_list, search_height, search_height_m def process_main(doi_input_list, search_height, search_depth, test_var = False): ''' -<<<<<<< HEAD :param doi_input_list: input list of doi from UI :type doi_input_list: list of strings @@ -380,19 +278,6 @@ def process_main(doi_input_list, search_height, search_depth, test_var = False): :type test_var: boolean ''' -======= - :param doi_input_list: list with dois from user - :type doi_input_list: list - :param search_height: recursion height - :type search_height: integer - :param search_depth: recursion depth - :type search_depth: integer - :param test_var: Wert, um zu entscheiden, ob die Test-Input-Funktion oder die Standartversion gewählt werden soll - :type test_var: Boolscher Wert (True = Test-Funkion, False = Standart-Funktion) - - # main function to call. Needs as input: - ''' ->>>>>>> 860565e76ef4ea961db9ca1564c95ac12ff9bf46 # ERROR-Handling doi_array = NULL if (len(doi_input_list) == 0): print("Error, no input data") diff --git a/verarbeitung/__pycache__/Processing.cpython-39.pyc b/verarbeitung/__pycache__/Processing.cpython-39.p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G&G<S5(O1PLO@Nkp-qXXX)I>;5|c#GaMFA?yF0V{&9}2ZTR&P^E0al%;rC?k zwG}kqWIr*k*m9s)i?eueDtd>pIVoc9#2F0oniQHdm=Q6#+>h1SLXeL?U=Oo64HF0| z(Y1Zcw_V4B9F3!5Z9{l4PJR-^x&YyHg;$F~k#c4TW)a#P6QPQp;ur>Vw4h;Lel@4r zeYtN|*^(UQJ_er?O(tLQgdFmUd|r&A-;+;Mk9W^vQY{4+C|6S=3J@otA|XYPCdd#F zVa*KAqgP8p8GkD62@ATt&YBqbJt$C&raDa?5d@M#GjC6fD(Vb&R&RFP)lI0->Jj=h z%p<sHUIT#yOfrL+ku+kAJZ`WwkFf|FXK9?5U-JFndS*sf8Hj9^HE9P`7=Vl7d7aU* z<aSX^P3|Jb93fnm?{c$?Cz#YR<|UeEB8-ijEXz#>^<bEba_1aQp?-__`+xm12m1Ad zz0vdGG;O8@ERi=$5DF-_^M%WQQ)?1qKA`<mE%`oQWs|}8{BGpRB@Db>ivT65sY8KA zU3j36K6@EMj_@hVXNBrXeO55$7us=sR)W1kk>91W?$uI?_l2XP1F#)G)QS2B76>RG zNMu+dAeF-wqgJe$FhvuZh`z0&yivL~uV2COi&E*sQnoDHDase671og7O1F0DeQYc4 zJ@Qn1VEMhiy$S~Istg*1FD+*~gB^bv`3YFJx&mT!EWLqtQZIFU;raSyv=f`2>tMHU nxglF!h9*xv7uG`JhNU&M`-iLc=H=URJ!6<x&4Sr7D`?f<Qls93 diff --git a/verarbeitung/import_from_json.py b/verarbeitung/import_from_json.py index 22e30ec..9fe099f 100644 --- a/verarbeitung/import_from_json.py +++ b/verarbeitung/import_from_json.py @@ -16,8 +16,9 @@ __status__ = "Production" import json #sys.path.insert(1, 'C:\Users\Malte\Git\CiS-Projekt\ci-s-projekt-verarbeitung\input') +import sys +sys.path.append("../") from input.interface import InputInterface as Input -#import input class Publication: diff --git a/verarbeitung/print_graph_test.py b/verarbeitung/print_graph_test.py index 23c2e73..3209485 100644 --- a/verarbeitung/print_graph_test.py +++ b/verarbeitung/print_graph_test.py @@ -17,9 +17,8 @@ __status__ = "Production" import sys #sys.path.insert(1, 'C:\Users\Malte\Git\CiS-Projekt\ci-s-projekt-verarbeitung\input') -sys.path.append(".") +sys.path.append("../") from input.interface import InputInterface as Input -#import input from Processing import process_main from import_from_json import input_from_json from update_graph import check_graph_updates diff --git a/verarbeitung/update_graph.py b/verarbeitung/update_graph.py index d178845..5711068 100644 --- a/verarbeitung/update_graph.py +++ b/verarbeitung/update_graph.py @@ -16,10 +16,9 @@ __status__ = "Production" import sys from pathlib import Path #sys.path.insert(1, 'C:\Users\Malte\Git\CiS-Projekt\ci-s-projekt-verarbeitung\input') -sys.path.append(".") +sys.path.append("../") from input.interface import InputInterface as Input from input_test import input_test_func -#import input from Knoten_Vergleich import doi_listen_vergleichen from Kanten_Vergleich import back_to_valid_edges -- GitLab