Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CiS Projekt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ockenden, Samuel
CiS Projekt
Commits
e8797743
Commit
e8797743
authored
3 years ago
by
Malte Schokolowski
Browse files
Options
Downloads
Patches
Plain Diff
verarbeitung fixed Errors in construct_graph_unittest.py
parent
071b5011
No related branches found
Branches containing commit
No related tags found
1 merge request
!16
verarbeitung fixed Errors in construct_graph_unittest.py
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
verarbeitung/test/construct_graph_unittest.py
+12
-12
12 additions, 12 deletions
verarbeitung/test/construct_graph_unittest.py
verarbeitung/update_graph/connect_new_input.py
+9
-1
9 additions, 1 deletion
verarbeitung/update_graph/connect_new_input.py
with
21 additions
and
13 deletions
verarbeitung/test/construct_graph_unittest.py
+
12
−
12
View file @
e8797743
...
@@ -14,12 +14,12 @@ class ConstructionTest(unittest.TestCase):
...
@@ -14,12 +14,12 @@ class ConstructionTest(unittest.TestCase):
def
testCycle
(
self
):
def
testCycle
(
self
):
nodes
,
edges
=
init_graph_construction
([
'
doiz1
'
],
1
,
1
,
True
,
False
)
nodes
,
edges
,
err_list
=
init_graph_construction
([
'
doiz1
'
],
1
,
1
,
True
,
False
)
doi_nodes
=
keep_only_dois
(
nodes
)
doi_nodes
=
keep_only_dois
(
nodes
)
self
.
assertCountEqual
(
doi_nodes
,
[
'
doiz1
'
,
'
doiz2
'
])
self
.
assertCountEqual
(
doi_nodes
,
[
'
doiz1
'
,
'
doiz2
'
])
self
.
assertCountEqual
(
edges
,
[[
'
doiz1
'
,
'
doiz2
'
],
[
'
doiz2
'
,
'
doiz1
'
]])
self
.
assertCountEqual
(
edges
,
[[
'
doiz1
'
,
'
doiz2
'
],
[
'
doiz2
'
,
'
doiz1
'
]])
nodes
,
edges
=
init_graph_construction
([
'
doiz1
'
],
2
,
2
,
True
,
False
)
nodes
,
edges
,
err_list
=
init_graph_construction
([
'
doiz1
'
],
2
,
2
,
True
,
False
)
doi_nodes
=
keep_only_dois
(
nodes
)
doi_nodes
=
keep_only_dois
(
nodes
)
self
.
assertCountEqual
(
doi_nodes
,
[
'
doiz1
'
,
'
doiz2
'
])
self
.
assertCountEqual
(
doi_nodes
,
[
'
doiz1
'
,
'
doiz2
'
])
self
.
assertCountEqual
(
edges
,
[[
'
doiz2
'
,
'
doiz1
'
],
[
'
doiz1
'
,
'
doiz2
'
]])
self
.
assertCountEqual
(
edges
,
[[
'
doiz2
'
,
'
doiz1
'
],
[
'
doiz1
'
,
'
doiz2
'
]])
...
@@ -31,56 +31,56 @@ class ConstructionTest(unittest.TestCase):
...
@@ -31,56 +31,56 @@ class ConstructionTest(unittest.TestCase):
#def testEmptyDepth(self):
#def testEmptyDepth(self):
def
testEmptyDepthHeight
(
self
):
def
testEmptyDepthHeight
(
self
):
nodes
,
edges
=
init_graph_construction
([
'
doi1
'
],
0
,
0
,
True
,
False
)
nodes
,
edges
,
err_list
=
init_graph_construction
([
'
doi1
'
],
0
,
0
,
True
,
False
)
doi_nodes
=
keep_only_dois
(
nodes
)
doi_nodes
=
keep_only_dois
(
nodes
)
self
.
assertCountEqual
(
doi_nodes
,[
'
doi1
'
])
self
.
assertCountEqual
(
doi_nodes
,[
'
doi1
'
])
self
.
assertCountEqual
(
edges
,
[])
self
.
assertCountEqual
(
edges
,
[])
nodes
,
edges
=
init_graph_construction
([
'
doi1
'
,
'
doi2
'
],
0
,
0
,
True
,
False
)
nodes
,
edges
,
err_list
=
init_graph_construction
([
'
doi1
'
,
'
doi2
'
],
0
,
0
,
True
,
False
)
doi_nodes
=
keep_only_dois
(
nodes
)
doi_nodes
=
keep_only_dois
(
nodes
)
self
.
assertCountEqual
(
doi_nodes
,
[
'
doi1
'
,
'
doi2
'
])
self
.
assertCountEqual
(
doi_nodes
,
[
'
doi1
'
,
'
doi2
'
])
self
.
assertCountEqual
(
edges
,
[[
'
doi1
'
,
'
doi2
'
]])
self
.
assertCountEqual
(
edges
,
[[
'
doi1
'
,
'
doi2
'
]])
nodes
,
edges
=
init_graph_construction
([
'
doi1
'
,
'
doi2
'
,
'
doi3
'
],
0
,
0
,
True
,
False
)
nodes
,
edges
,
err_list
=
init_graph_construction
([
'
doi1
'
,
'
doi2
'
,
'
doi3
'
],
0
,
0
,
True
,
False
)
doi_nodes
=
keep_only_dois
(
nodes
)
doi_nodes
=
keep_only_dois
(
nodes
)
self
.
assertCountEqual
(
doi_nodes
,
[
'
doi1
'
,
'
doi2
'
,
'
doi3
'
])
self
.
assertCountEqual
(
doi_nodes
,
[
'
doi1
'
,
'
doi2
'
,
'
doi3
'
])
self
.
assertCountEqual
(
edges
,
[[
'
doi3
'
,
'
doi1
'
],
[
'
doi1
'
,
'
doi2
'
]])
self
.
assertCountEqual
(
edges
,
[[
'
doi3
'
,
'
doi1
'
],
[
'
doi1
'
,
'
doi2
'
]])
def
testInnerEdges
(
self
):
def
testInnerEdges
(
self
):
nodes
,
edges
=
init_graph_construction
([
'
doi_ie1
'
],
1
,
1
,
True
,
False
)
nodes
,
edges
,
err_list
=
init_graph_construction
([
'
doi_ie1
'
],
1
,
1
,
True
,
False
)
doi_nodes
=
keep_only_dois
(
nodes
)
doi_nodes
=
keep_only_dois
(
nodes
)
self
.
assertCountEqual
(
doi_nodes
,[
'
doi_ie1
'
,
'
doi_ie2
'
,
'
doi_ie3
'
])
self
.
assertCountEqual
(
doi_nodes
,[
'
doi_ie1
'
,
'
doi_ie2
'
,
'
doi_ie3
'
])
self
.
assertCountEqual
(
edges
,[[
'
doi_ie1
'
,
'
doi_ie2
'
],[
'
doi_ie3
'
,
'
doi_ie1
'
],[
'
doi_ie3
'
,
'
doi_ie2
'
]])
self
.
assertCountEqual
(
edges
,[[
'
doi_ie1
'
,
'
doi_ie2
'
],[
'
doi_ie3
'
,
'
doi_ie1
'
],[
'
doi_ie3
'
,
'
doi_ie2
'
]])
def
testRightHeight
(
self
):
def
testRightHeight
(
self
):
nodes
,
edges
=
init_graph_construction
([
'
doi_h01
'
],
0
,
1
,
True
,
False
)
nodes
,
edges
,
err_list
=
init_graph_construction
([
'
doi_h01
'
],
0
,
1
,
True
,
False
)
doi_nodes
=
keep_only_dois
(
nodes
)
doi_nodes
=
keep_only_dois
(
nodes
)
self
.
assertCountEqual
(
doi_nodes
,[
'
doi_h01
'
])
self
.
assertCountEqual
(
doi_nodes
,[
'
doi_h01
'
])
self
.
assertCountEqual
(
edges
,
[])
self
.
assertCountEqual
(
edges
,
[])
nodes
,
edges
=
init_graph_construction
([
'
doi_h02
'
],
0
,
1
,
True
,
False
)
nodes
,
edges
,
err_list
=
init_graph_construction
([
'
doi_h02
'
],
0
,
1
,
True
,
False
)
doi_nodes
=
keep_only_dois
(
nodes
)
doi_nodes
=
keep_only_dois
(
nodes
)
self
.
assertCountEqual
(
doi_nodes
,[
'
doi_h02
'
,
'
doi_h1
'
])
self
.
assertCountEqual
(
doi_nodes
,[
'
doi_h02
'
,
'
doi_h1
'
])
self
.
assertCountEqual
(
edges
,
[[
'
doi_h1
'
,
'
doi_h02
'
]])
self
.
assertCountEqual
(
edges
,
[[
'
doi_h1
'
,
'
doi_h02
'
]])
nodes
,
edges
=
init_graph_construction
([
'
doi_h02
'
],
0
,
2
,
True
,
False
)
nodes
,
edges
,
err_list
=
init_graph_construction
([
'
doi_h02
'
],
0
,
2
,
True
,
False
)
doi_nodes
=
keep_only_dois
(
nodes
)
doi_nodes
=
keep_only_dois
(
nodes
)
self
.
assertCountEqual
(
doi_nodes
,[
'
doi_h02
'
,
'
doi_h1
'
,
'
doi_h2
'
])
self
.
assertCountEqual
(
doi_nodes
,[
'
doi_h02
'
,
'
doi_h1
'
,
'
doi_h2
'
])
self
.
assertCountEqual
(
edges
,
[[
'
doi_h1
'
,
'
doi_h02
'
],
[
'
doi_h2
'
,
'
doi_h1
'
]])
self
.
assertCountEqual
(
edges
,
[[
'
doi_h1
'
,
'
doi_h02
'
],
[
'
doi_h2
'
,
'
doi_h1
'
]])
def
testRightDepth
(
self
):
def
testRightDepth
(
self
):
nodes
,
edges
=
init_graph_construction
([
'
doi_d01
'
],
1
,
0
,
True
,
False
)
nodes
,
edges
,
err_list
=
init_graph_construction
([
'
doi_d01
'
],
1
,
0
,
True
,
False
)
doi_nodes
=
keep_only_dois
(
nodes
)
doi_nodes
=
keep_only_dois
(
nodes
)
self
.
assertCountEqual
(
doi_nodes
,[
'
doi_d01
'
])
self
.
assertCountEqual
(
doi_nodes
,[
'
doi_d01
'
])
self
.
assertCountEqual
(
edges
,
[])
self
.
assertCountEqual
(
edges
,
[])
nodes
,
edges
=
init_graph_construction
([
'
doi_d02
'
],
1
,
0
,
True
,
False
)
nodes
,
edges
,
err_list
=
init_graph_construction
([
'
doi_d02
'
],
1
,
0
,
True
,
False
)
doi_nodes
=
keep_only_dois
(
nodes
)
doi_nodes
=
keep_only_dois
(
nodes
)
self
.
assertCountEqual
(
doi_nodes
,[
'
doi_d02
'
,
'
doi_d1
'
])
self
.
assertCountEqual
(
doi_nodes
,[
'
doi_d02
'
,
'
doi_d1
'
])
self
.
assertCountEqual
(
edges
,
[[
'
doi_d02
'
,
'
doi_d1
'
]])
self
.
assertCountEqual
(
edges
,
[[
'
doi_d02
'
,
'
doi_d1
'
]])
nodes
,
edges
=
init_graph_construction
([
'
doi_d02
'
],
2
,
0
,
True
,
False
)
nodes
,
edges
,
err_list
=
init_graph_construction
([
'
doi_d02
'
],
2
,
0
,
True
,
False
)
doi_nodes
=
keep_only_dois
(
nodes
)
doi_nodes
=
keep_only_dois
(
nodes
)
self
.
assertCountEqual
(
doi_nodes
,[
'
doi_d02
'
,
'
doi_d1
'
,
'
doi_d2
'
])
self
.
assertCountEqual
(
doi_nodes
,[
'
doi_d02
'
,
'
doi_d1
'
,
'
doi_d2
'
])
self
.
assertCountEqual
(
edges
,
[[
'
doi_d02
'
,
'
doi_d1
'
],
[
'
doi_d1
'
,
'
doi_d2
'
]])
self
.
assertCountEqual
(
edges
,
[[
'
doi_d02
'
,
'
doi_d1
'
],
[
'
doi_d1
'
,
'
doi_d2
'
]])
...
...
This diff is collapsed.
Click to expand it.
verarbeitung/update_graph/connect_new_input.py
+
9
−
1
View file @
e8797743
...
@@ -42,6 +42,12 @@ def complete_changed_group_nodes_test(test_nodes, test_edges, inserted_test_node
...
@@ -42,6 +42,12 @@ def complete_changed_group_nodes_test(test_nodes, test_edges, inserted_test_node
def
find_furthermost_citations
(
new_nodes
,
new_edges
,
node
,
old_search_depth
,
cit_type
):
def
find_furthermost_citations
(
new_nodes
,
new_edges
,
node
,
old_search_depth
,
cit_type
):
'''
'''
:param new_nodes: list of nodes which are generated seperately from main node list to avoid recursive problems
:type new_nodes List[Publication]
:param new_edges: list of edges which are generated seperately from main edge list to avoid recursive problems
:type new_edges: List[List[String,String]]
:param node: node which is known but not from input group
:param node: node which is known but not from input group
:type node: Publication
:type node: Publication
...
@@ -51,7 +57,9 @@ def find_furthermost_citations(new_nodes, new_edges, node, old_search_depth, cit
...
@@ -51,7 +57,9 @@ def find_furthermost_citations(new_nodes, new_edges, node, old_search_depth, cit
:param cit_type: determines whether the function call is for a reference or citation
:param cit_type: determines whether the function call is for a reference or citation
:type cit_type: String
:type cit_type: String
function to find the furthermost citation/reference for given node which is from the same group
function to find the furthermost citation/reference for given node which is from the same group and
adds all found nodes between input node and furthermost citations.
It return a list of furthermost citations.
'''
'''
citations_saved
=
[
node
]
citations_saved
=
[
node
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment