Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SMART
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UNI-KLU
SMART
Commits
cf555c9f
Commit
cf555c9f
authored
Apr 29, 2020
by
Alexander Lercher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Running time slicing also if there was no clustering
Just assume one large cluster for all nodes for that layer
parent
74e9c2e7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
repository.py
...hub/community-detection-microservice/app/db/repository.py
+1
-1
run_time_slicing.py
.../community-detection-microservice/app/run_time_slicing.py
+5
-0
No files found.
src/data-hub/community-detection-microservice/app/db/repository.py
View file @
cf555c9f
...
@@ -97,7 +97,7 @@ class Repository(MongoRepositoryBase):
...
@@ -97,7 +97,7 @@ class Repository(MongoRepositoryBase):
super
()
.
insert_many
(
self
.
_layer_nodes_collection
,
nodes
)
super
()
.
insert_many
(
self
.
_layer_nodes_collection
,
nodes
)
def
get_layer_nodes
(
self
,
layer_name
:
str
)
->
dict
:
def
get_layer_nodes
(
self
,
layer_name
:
str
)
->
dict
:
'''Returns
from json
'''
'''Returns
all nodes for the layer.
'''
entries
=
super
()
.
get_entries
(
self
.
_layer_nodes_collection
,
selection
=
{
'layer_name'
:
layer_name
},
projection
=
{
'_id'
:
0
})
entries
=
super
()
.
get_entries
(
self
.
_layer_nodes_collection
,
selection
=
{
'layer_name'
:
layer_name
},
projection
=
{
'_id'
:
0
})
return
[
e
for
e
in
entries
]
return
[
e
for
e
in
entries
]
...
...
src/data-hub/community-detection-microservice/app/run_time_slicing.py
View file @
cf555c9f
...
@@ -59,7 +59,12 @@ if __name__ == "__main__":
...
@@ -59,7 +59,12 @@ if __name__ == "__main__":
for
layer
in
layers
:
for
layer
in
layers
:
layer_name
=
layer
.
layer_name
layer_name
=
layer
.
layer_name
print
(
f
"Working on {layer_name}"
)
print
(
f
"Working on {layer_name}"
)
clusters_for_layer
=
repo
.
get_clusters_for_layer
(
layer_name
)
clusters_for_layer
=
repo
.
get_clusters_for_layer
(
layer_name
)
# if no clusters were generated use one large cluster instead of skipping the layer
if
clusters_for_layer
is
None
or
len
(
clusters_for_layer
)
==
0
:
clusters_for_layer
=
[
Cluster
(
layer_name
,
-
1
,
repo
.
get_layer_nodes
(
layer_name
))]
time_slices
=
split_clusterset_by_time
(
layer_name
,
clusters_for_layer
)
time_slices
=
split_clusterset_by_time
(
layer_name
,
clusters_for_layer
)
for
k
,
v
in
time_slices
.
items
():
for
k
,
v
in
time_slices
.
items
():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment