Skip to content

Commit

Permalink
code styles
Browse files Browse the repository at this point in the history
  • Loading branch information
wiheto committed Feb 6, 2019
1 parent 92cab05 commit f79a385
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions teneto/networkmeasures/shortest_temporal_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ def seqpath_to_path(pairseq, source):
# Get all remaining possible paths in sequence
iterset = set(np.where((pairrows == pairrows[node, 0]) | (
pairrows == pairrows[node, 1]))[0]) - set(range(node+1))
for next in iterset:
if source in pairrows[next]:
yield list(reversed(pairrows[path + [next]].tolist()))
for nextset in iterset:
if source in pairrows[nextset]:
yield list(reversed(pairrows[path + [nextset]].tolist()))
else:
queue.append((next, path + [next]))
queue.append((nextset, path + [nextset]))


def shortest_path_from_pairseq(pairseq, source):
Expand Down
8 changes: 4 additions & 4 deletions teneto/networkmeasures/temporal_degree_centrality.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,24 @@ def temporal_degree_centrality(tnet, axis=0, calc='avg', communities=None, decay
net : array, dict
Temporal network input (graphlet or contact). Can have nettype: 'bu', 'bd', 'wu', 'wd'
axis : int
axis : int
Dimension that is returned 0 or 1 (default 0).
Note, only relevant for directed networks.
i.e. if 0, node i has Aijt summed over j and t.
and if 1, node j has Aijt summed over i and t.
calc : str
Can be following alternatives:
Can be following alternatives:
'avg' : (returns temporal degree centrality (a 1xnode vector))
'time' : (returns a node x time matrix),
'module_degree_zscore' : returns the Z-scored within community degree centrality
'module_degree_zscore' : returns the Z-scored within community degree centrality
(communities argument required). This is done for each time-point
i.e. 'time' returns static degree centrality per time-point.
ignorediagonal: bool
if true, diagonal is made to 0.
if true, diagonal is made to 0.
communities : array (Nx1)
Vector of community assignment.
If this is given and calc='time', then the strength within and between each communities is returned (technically not degree centrality).
Expand Down
4 changes: 2 additions & 2 deletions teneto/networkmeasures/temporal_participation_coeff.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def temporal_participation_coeff(tnet, communities=None, decay=None, removeneg=F
communities : array
community vector. Either 1D (node) community index or 2D (node,time).
removeneg : bool (default false)
If true, all values < 0 are made to be 0.
If true, all values < 0 are made to be 0.
Returns
Expand All @@ -29,7 +29,7 @@ def temporal_participation_coeff(tnet, communities=None, decay=None, removeneg=F
Static participatoin coefficient is:
.. math:: P_i = 1 - \sum_s^{N_M}({{k_{is}}\over{k_i}})^2
.. math:: P_i = 1 - \sum_s^{N_M}({{k_{is}}\over{k_i}})^2
Where s is the index of each community (:math:`N_M`). :math:`k_i` is total degree of node. And :math:`k_{is}` is degree of connections within community.[part-1]_
Expand Down
2 changes: 1 addition & 1 deletion teneto/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
Many helper functions for Teneto
"""

from .bidsutils import *
from .bidsutils import *
from .utils import *
from .io import *

0 comments on commit f79a385

Please sign in to comment.