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
Merge requests
!12
bug fixes and updates to code
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
bug fixes and updates to code
bav1758/ci-s-projekt-verarbeitung:main
into
main
Overview
0
Commits
29
Pipelines
0
Changes
18
Merged
Schokolowski, Malte
requested to merge
bav1758/ci-s-projekt-verarbeitung:main
into
main
3 years ago
Overview
0
Commits
29
Pipelines
0
Changes
2
Expand
0
0
Merge request reports
Compare
version 2
version 2
6d27e4e2
3 years ago
version 1
b1d80ea8
3 years ago
main (base)
and
latest version
latest version
d2fd9bc9
29 commits,
3 years ago
version 2
6d27e4e2
28 commits,
3 years ago
version 1
b1d80ea8
27 commits,
3 years ago
Show latest version
2 files
+
37
−
3
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
verarbeitung/test/construct_graph_unittest.py
+
32
−
2
Options
import
unittest
import
sys
import
sys
sys
.
path
.
append
(
"
../
"
)
from
verarbeitung.construct_new_graph.initialize_graph
import
init_graph_construction
,
initialize_nodes_list_test
,
complete_inner_edges_test
from
verarbeitung.construct_new_graph.add_citations_rec
import
get_cit_type_list
,
create_graph_structure_citations_test
from
verarbeitung.construct_new_graph.export_to_json
import
format_nodes
,
format_edges
from
verarbeitung.test.input_test
import
input_test_func
class
ConstructionTest
(
unittest
.
TestCase
):
@@ -182,6 +182,36 @@ class ConstructionTest(unittest.TestCase):
self
.
assertCountEqual
(
return_edges
,
[[
'
doi_lg_1_h11
'
,
'
doi_lg_1_i
'
],[
'
doi_lg_1_h12
'
,
'
doi_lg_1_i
'
],[
'
doi_lg_1_i
'
,
'
doi_lg_1_d11
'
]])
self
.
assertCountEqual
(
cit_list
,
[])
## export_to_json.py:
def
test_format_nodes
(
self
):
pub_lg_1_i
=
input_test_func
(
'
doi_lg_1_i
'
)
pub_lg_1_i
.
group
=
0
pub_lg_1_h_11
=
input_test_func
(
'
doi_lg_1_h11
'
)
pub_lg_1_h_11
.
group
=
1
pub_lg_1_d_11
=
input_test_func
(
'
doi_lg_1_d11
'
)
pub_lg_1_d_11
.
group
=
-
1
return_list_of_node_dicts
=
format_nodes
([
pub_lg_1_i
,
pub_lg_1_h_11
,
pub_lg_1_d_11
])
check_list_of_node_dicts
=
[
{
"
doi
"
:
'
doi_lg_1_i
'
,
"
name
"
:
'
title_lg_1_i
'
,
"
author
"
:
[
'
contributor_lg_1_i
'
],
"
year
"
:
'
date_lg_1_i
'
,
"
journal
"
:
'
journal_lg_1_i
'
,
"
group
"
:
'
Input
'
,
"
depth
"
:
0
,
"
citations
"
:
2
},
{
"
doi
"
:
'
doi_lg_1_h11
'
,
"
name
"
:
'
title_lg_1_h11
'
,
"
author
"
:
[
'
contributor_lg_1_h11
'
],
"
year
"
:
'
date_lg_1_h11
'
,
"
journal
"
:
'
journal_lg_1_h11
'
,
"
group
"
:
'
Citedby
'
,
"
depth
"
:
1
,
"
citations
"
:
2
},
{
"
doi
"
:
'
doi_lg_1_d11
'
,
"
name
"
:
'
title_lg_1_d11
'
,
"
author
"
:
[
'
contributor_lg_1_d11
'
],
"
year
"
:
'
date_lg_1_d11
'
,
"
journal
"
:
'
journal_lg_1_d11
'
,
"
group
"
:
'
Reference
'
,
"
depth
"
:
-
1
,
"
citations
"
:
1
}]
self
.
assertCountEqual
(
return_list_of_node_dicts
,
check_list_of_node_dicts
)
def
test_format_edges
(
self
):
return_list_of_edges
=
format_edges
([[
'
doi_lg_1_i
'
,
'
doi_lg_1_d11
'
],[
'
doi_lg_1_i
'
,
'
doi_lg_1_d12
'
],[
'
doi_lg_1_h11
'
,
'
doi_lg_1_i
'
],[
'
doi_lg_1_h12
'
,
'
doi_lg_1_i
'
]])
check_list_of_edges
=
[{
"
source
"
:
'
doi_lg_1_i
'
,
"
target
"
:
'
doi_lg_1_d11
'
},{
"
source
"
:
'
doi_lg_1_i
'
,
"
target
"
:
'
doi_lg_1_d12
'
},
{
"
source
"
:
'
doi_lg_1_h11
'
,
"
target
"
:
'
doi_lg_1_i
'
},{
"
source
"
:
'
doi_lg_1_h12
'
,
"
target
"
:
'
doi_lg_1_i
'
}]
self
.
assertCountEqual
(
return_list_of_edges
,
check_list_of_edges
)
def
keep_only_dois
(
nodes
):
Loading