File tree Expand file tree Collapse file tree 4 files changed +16
-10
lines changed
Expand file tree Collapse file tree 4 files changed +16
-10
lines changed Original file line number Diff line number Diff line change 1- __version__ = '0.4.1 '
1+ __version__ = '0.4.2 '
Original file line number Diff line number Diff line change @@ -168,6 +168,14 @@ def load_synthetic_network_as_graph(
168168 connection_threshold : float = 50.0 ,
169169 walk_speed_kmph : float = 4.5 ,
170170 impute_walk_transfers : bool = True ):
171+ """
172+ Convert a formatter transit FeatureCollection into a directed network graph.
173+
174+ Utilizing a correctly formatted transit FeatureCollection, generate a
175+ directed networ graph (or add to an existing one), based off of features
176+ included in the reference_geojson parameter.
177+ """
178+
171179
172180 # Generate a random name for name if it is None
173181 if not name :
Original file line number Diff line number Diff line change 11import os
22
3- import matplotlib
43import networkx as nx
54import osmnx as ox
65
7- # Check if the display has already been set and, if not...
8- cmd = 'python -c "import matplotlib.pyplot as plt;plt.figure()"'
9- check = os .system (cmd )
10- if check != 0 :
11- # Force matplotlib to not use any Xwindows backend
12- matplotlib .use ('Agg' )
136
7+ def generate_plot (G : nx .MultiDiGraph , use_agg = False ):
8+ # Load matplotlib only when plot requested
9+ import matplotlib # noqa
10+ if use_agg :
11+ # Force matplotlib to not use any Xwindows backend
12+ matplotlib .use ('Agg' )
1413
15- def generate_plot (G : nx .MultiDiGraph ):
1614 # TODO: Build out custom plotting configurations but,
1715 # in the meantime, use OSMnx's plotting configurations
1816 # since they work well for the current use case and I
Original file line number Diff line number Diff line change @@ -17,4 +17,4 @@ def test_feed_to_graph_plot():
1717
1818 G = load_feed_as_graph (feed , start , end )
1919
20- fig , ax = generate_plot (G )
20+ fig , ax = generate_plot (G , use_agg = True )
You can’t perform that action at this time.
0 commit comments