Skip to content

jstonge/tidygraphtool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tidygraphtool

A tidy API for network manipulation with graph-tool library inspired by tidygraph. This is an experimental project of mine. Use at your own risk.

Usage

from tidygraphtool.all import *
g = play_sbm(n_k=500)
(
  g >>
    activate("nodes") >>
    add_property("degree", centrality_degree, mode="total") >>
    filter_on("degree == 2") >>
    summary()
)

Installation

Installation is a bit weird because graph-tool cannot be pip-install. The easiest way to install is to clone this repo, then from the root directory of the package:

conda env create --file tidy_gt.yml &&
conda activate tidy_gt &&
pip install tidygraphtool

The first and second lines create an environement with all the depenencies from gt.yml. The third line install tidygraphtool from pypi the package at large within the gt environment.

INSPIRATION

MODELS TO INTEGRATE

PROTOYPE FUNCTIONAL INTERFACE

#### Current
g = gt_graph(nodes=nodes, edges=edges)
g = add_property(g, "node_coreness", node_coreness)
g = add_property(g, "pr", centrality_pagerank)
g = filter_on(g, "node_coreness > 3")
g = activate(g, "edges")
g = add_property(g, "edge_bet", centrality_edge_betweenness)
g = gt_graph(nodes=nodes, edges=edges)
g = (g >>
       add_property("node_coreness", node_coreness(g)) >>
       add_property("pr", centrality_pagerank(g)) >>
       filter_on("node_coreness > 3 & pr > 10") >>
       activate("edges") >>
       add_property("edge_bet", centrality_edge_betweenness(g)))

About

A tidy API for network manipulation with Graph-tool inspired by tidygraph.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages