Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tiago Peixoto
graph-tool
Commits
c65210b4
Commit
c65210b4
authored
Dec 03, 2007
by
Tiago Peixoto
Browse files
Properly parse some degree arguments, which can also be properies
parent
d5356666
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/graph_tool.py
View file @
c65210b4
...
...
@@ -620,7 +620,7 @@ class Graph(object):
@
_limit_args
({
"strategy"
:[
"correlated"
,
"uncorrelated"
]})
def
random_rewire
(
self
,
strategy
=
"uncorrelated"
,
parallel_edges
=
False
,
self_loops
=
False
,
seed
=
int
(
time
.
time
())):
"""Randomly rewire the edges of the graph"""
"""Randomly rewire the edges of the graph"""
self
.
__graph
.
RandomRewire
(
strategy
,
self_loops
,
parallel_edges
,
seed
)
# Basic graph statistics
...
...
@@ -782,8 +782,8 @@ class Graph(object):
def
average_combined_vertex_correlation
(
self
,
degree1
,
degree2
):
"""Get the average of degree2 in function of degree1. Scalar properties
are also accepted as degree1 or degree2"""
return
self
.
__graph
.
GetAverageCombinedVertexCorrelation
(
degree1
,
degree2
)
f
=
self
.
__graph
.
GetAverageCombinedVertexCorrelation
return
f
(
_degree
(
degree1
),
_degree
(
degree2
)
)
@
_attrs
(
opt_group
=
__groups
[
-
1
],
has_output
=
True
)
@
_handle_exceptions
...
...
@@ -794,8 +794,8 @@ class Graph(object):
passed by weight"""
if
weight
==
None
:
weight
=
""
self
.
__graph
.
GetVertexCorrelationHistogram
(
origin_degree
,
neighbour_degree
,
weight
)
f
=
self
.
__graph
.
GetVertexCorrelationHistogram
return
f
(
_degree
(
origin_degree
),
_degree
(
neighbour_degree
)
,
weight
)
@
_attrs
(
opt_group
=
__groups
[
-
1
],
has_output
=
True
)
@
_handle_exceptions
...
...
Write
Preview
Supports
Markdown
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