kuanb / peartree

peartree: A library for converting transit data into a directed graph for sketch network analysis.
MIT License
201 stars 23 forks source link

[graph_tool] Export interface to graph_tool #100

Closed kuanb closed 5 years ago

kuanb commented 5 years ago

Fixes https://github.com/kuanb/peartree/issues/2

Includes environment (Docker-related updates) to support Docker image with graph-tool installed.

Example use case:

# Read in a peartree NetworkX graph
path = 'peartree_graph.zip'
G = pt.utilities.graph_from_zip(path)
G.graph['crs'] = {'init': 'epsg:2163'}
G.graph['name'] = 'foo'

# Convert to a graph-tool graph simply
from peartree.graph_tool import nx_to_gt
gtG = nx_to_gt(G.copy())
codecov[bot] commented 5 years ago

Codecov Report

Merging #100 into master will decrease coverage by 6.54%. The diff coverage is 12.5%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #100      +/-   ##
==========================================
- Coverage   91.79%   85.25%   -6.55%     
==========================================
  Files          12       13       +1     
  Lines         890      970      +80     
==========================================
+ Hits          817      827      +10     
- Misses         73      143      +70
Impacted Files Coverage Δ
peartree/__init__.py 100% <100%> (ø) :arrow_up:
peartree/graph_tool.py 11.39% <11.39%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update f31a7f7...a49ba69. Read the comment docs.

kuanb commented 5 years ago

Perhaps unnecessary, but here is a screen capture of this being used in a Notebook: image

kuanb commented 5 years ago

Welp, runtime for Travis now takes 40 min 4 sec... 🤷

Gonna leave that as a problem for another day.