Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
graph-tool
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
40
Issues
40
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tiago Peixoto
graph-tool
Commits
92b2d5f6
Commit
92b2d5f6
authored
Feb 23, 2017
by
Tiago Peixoto
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
random_rewire(): Raise warning if edge_probs is not supplied
parent
6ba6b6af
Pipeline
#270
passed with stage
in 184 minutes and 29 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
13 deletions
+2
-13
src/graph_tool/generation/__init__.py
src/graph_tool/generation/__init__.py
+2
-13
No files found.
src/graph_tool/generation/__init__.py
View file @
92b2d5f6
...
...
@@ -791,19 +791,6 @@ def random_rewire(g, model="configuration", n_iter=1, edge_sweep=True,
no. 1: 016107 (2011) :doi:`10.1103/PhysRevE.83.016107` :arxiv:`1008.3926`
"""
# if not parallel_edges:
# p = label_parallel_edges(g)
# if p.a.max() != 0:
# raise ValueError("Parallel edge detected. Can't rewire " +
# "graph without parallel edges if it " +
# "already contains parallel edges!")
# if not self_loops:
# l = label_self_loops(g)
# if l.a.max() != 0:
# raise ValueError("Self-loop detected. Can't rewire graph " +
# "without self-loops if it already contains" +
# " self-loops!")
if
(
edge_probs
is
not
None
and
not
g
.
is_directed
())
and
"blockmodel"
not
in
model
:
corr
=
lambda
i
,
j
:
edge_probs
(
i
[
1
],
j
[
1
])
...
...
@@ -813,6 +800,8 @@ def random_rewire(g, model="configuration", n_iter=1, edge_sweep=True,
if
model
not
in
[
"probabilistic-configuration"
,
"blockmodel"
,
"blockmodel-degree"
]:
g
=
GraphView
(
g
,
reversed
=
False
)
elif
edge_probs
is
None
:
raise
ValueError
(
"A function must be supplied as the 'edge_probs' parameter"
)
if
model
==
"blockmodel-degree"
and
alias
and
edge_sweep
:
edge_sweep
=
False
...
...
Tiago Peixoto
@count0
mentioned in issue
#371 (closed)
·
Feb 23, 2017
mentioned in issue
#371 (closed)
mentioned in issue #371
Toggle commit list
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