Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PanGeTools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Alexis Mergez
PanGeTools
Commits
52ea35c4
Commit
52ea35c4
authored
6 months ago
by
Alexis Mergez
Browse files
Options
Downloads
Patches
Plain Diff
Silenced debug and fixed multiprocessing
parent
9059deea
No related branches found
No related tags found
No related merge requests found
Pipeline
#232601
passed
6 months ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
GFAstats.py
+5
-5
5 additions, 5 deletions
GFAstats.py
with
5 additions
and
5 deletions
GFAstats.py
+
5
−
5
View file @
52ea35c4
...
...
@@ -296,7 +296,7 @@ for query_id in range(len(all_paths[:-1])):
for
target_id
in
range
(
query_id
+
1
,
len
(
all_paths
)):
query
,
target
=
all_paths
[
query_id
],
all_paths
[
target_id
]
value
=
get_shared_nodes
(
query
,
target
)
if
args
.
progress
:
print
(
f
"
[GFAstats::
{
panname
}
]
\t
Found
{
len
(
value
)
}
"
)
#
if args.progress: print(f"[GFAstats::{panname}]\tFound {len(value)}")
shared_nodes
[(
query
,
target
)]
=
value
def
get_shared_content
(
query
,
pathDict
=
pathStats
,
nodesLengthDict
=
nodesLengthDict
,
shared_nodes
=
shared_nodes
,
showProgress
=
args
.
progress
,
panname
=
panname
):
...
...
@@ -317,7 +317,7 @@ def get_shared_content(query, pathDict=pathStats, nodesLengthDict=nodesLengthDic
_shared
=
set
(
shared_nodes
[(
target
,
query
)])
# Number of shared nodes traversing the current path (without repeats)
print
(
len
(
_shared
))
#
print(len(_shared))
_stats
[
target
][
"
shared.nodes.count
"
]
=
len
(
_shared
)
# Length of shared nodes traversing the current path (without repeats)
...
...
@@ -325,7 +325,7 @@ def get_shared_content(query, pathDict=pathStats, nodesLengthDict=nodesLengthDic
nodesLengthDict
[
nodeid
]
for
nodeid
in
_shared
])
print
(
"
without repeats :
"
,
_stats
[
target
][
"
shared.length
"
])
#
print("without repeats : ", _stats[target]["shared.length"])
# Length of shared nodes traversing the current path (with repeats)
_stats
[
target
][
"
shared.R.length
"
]
=
np
.
sum
([
...
...
@@ -333,12 +333,12 @@ def get_shared_content(query, pathDict=pathStats, nodesLengthDict=nodesLengthDic
for
nodeid
in
pathDict
[
query
][
"
Path.nodes
"
]
if
nodeid
in
_shared
])
print
(
"
with repeats :
"
,
_stats
[
target
][
"
shared.R.length
"
])
#
print("with repeats : ", _stats[target]["shared.R.length"])
return
_stats
# Multithreading the path statistics retrieving
executor
=
concurrent
.
futures
.
ThreadPoolExecutor
(
max_workers
=
1
)
executor
=
concurrent
.
futures
.
ThreadPoolExecutor
(
max_workers
=
args
.
threads
)
res
=
{}
for
pathname
in
pathStats
.
keys
():
res
[
pathname
]
=
executor
.
submit
(
get_shared_content
,
pathname
)
...
...
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