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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beitung/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