Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bedartha Goswami
uncertise
Commits
b9d35494
Commit
b9d35494
authored
May 05, 2020
by
Norbert Marwan
Browse files
update to make Python 3 compatible
parent
025b3cae
Changes
1
Hide whitespace changes
Inline
Side-by-side
events.py
View file @
b9d35494
...
...
@@ -66,7 +66,7 @@ def __divide_at_midpoint(G):
Returns subgraphs by cutting the recurrence network at the midpoint.
"""
n
=
G
.
vcount
()
inds1
,
inds2
=
range
(
0
,
n
/
2
),
range
(
n
/
2
,
n
)
inds1
,
inds2
=
range
(
0
,
int
(
n
/
2
)
)
,
range
(
int
(
n
/
2
)
,
n
)
G1
,
G2
=
G
.
subgraph
(
G
.
vs
[
inds1
]),
G
.
subgraph
(
G
.
vs
[
inds2
])
return
G1
,
G2
...
...
@@ -82,10 +82,10 @@ def community_strength_data(G, time, wsize, wstep,
n
=
G
.
vcount
()
nwind
=
((
n
-
wsize
)
/
wstep
)
+
1
tmid
=
[]
Q
,
LD
=
[
np
.
zeros
(
nwind
)
for
i
in
range
(
2
)]
Q
,
LD
=
[
np
.
zeros
(
int
(
nwind
)
)
for
i
in
range
(
2
)]
_printmsg
(
"Estimating intra-community link fraction..."
,
verbose
)
prog_bar
=
_progressbar_start
(
n
,
pbar
)
for
i
in
range
(
nwind
):
for
i
in
range
(
int
(
nwind
)
)
:
k
=
i
*
wstep
start
,
stop
=
k
,
k
+
wsize
t_
=
(
time
[
start
:
stop
]).
sum
()
/
wsize
...
...
@@ -109,11 +109,11 @@ def community_strength_random_model(G, time, wsize, wstep, nsurr,
n
=
G
.
vcount
()
nwind
=
((
n
-
wsize
)
/
wstep
)
+
1
tmid
=
[]
Qsurr
,
LDsurr
=
[
np
.
zeros
((
nwind
,
nsurr
),
"float"
)
for
i
in
range
(
2
)]
Qsurr
,
LDsurr
=
[
np
.
zeros
((
int
(
nwind
)
,
int
(
nsurr
)
)
,
"float"
)
for
i
in
range
(
2
)]
_printmsg
(
"Estimating intra-community link fraction..."
,
verbose
)
prog_bar
=
_progressbar_start
(
nwind
*
nsurr
,
pbar
)
count
=
0
for
i
in
range
(
nwind
):
for
i
in
range
(
int
(
nwind
)
)
:
k
=
i
*
wstep
start
,
stop
=
k
,
k
+
wsize
t_
=
(
time
[
start
:
stop
]).
sum
()
/
wsize
...
...
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