Skip to content

Commit

Permalink
Fixed bug in the network edge bundling
Browse files Browse the repository at this point in the history
minor update to documentation
  • Loading branch information
fccoelho committed Feb 21, 2021
1 parent 601ecf1 commit 3a46457
Show file tree
Hide file tree
Showing 25 changed files with 2,116 additions and 2,046 deletions.
55 changes: 38 additions & 17 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions Epigrass/epipanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import holoviews as hv
import geoviews as gv
from holoviews.operation.datashader import datashade, bundle_graph
from datashader.bundling import hammer_bundle
from holoviews import opts
from bokeh.resources import INLINE
import param
Expand Down Expand Up @@ -50,9 +51,10 @@ def get_sims(fname):
def get_graph(pth):
full_path = os.path.join(os.path.abspath(pth), 'network.gml')
if os.path.exists(full_path):
G = NX.read_gml(full_path)
G = NX.read_gml(full_path,destringizer=int)
else:
G = NX.MultiDiGraph()

return G


Expand Down Expand Up @@ -118,7 +120,7 @@ def get_subgraph(G, node):
:param node: node defining the subgraph
"""
nodes = [node]
nodes.extend(list(G.neighbors(node)))
nodes.extend([int(n) for n in G.neighbors(node)])
H = G.subgraph(nodes).copy()
return H

Expand Down Expand Up @@ -246,7 +248,7 @@ def view_network(self):
partial_map = partial_map.to_crs(3857) # Converting to web mercator
centroids = [(c.x, c.y) for c in partial_map.centroid]
# Draw the graph using Altair
gcs = [str(int(gc)) for gc in partial_map.geocode]
gcs = [int(gc) for gc in partial_map.geocode]
pos = dict(zip(gcs, centroids))

# viz = nxa.draw_networkx(
Expand Down
13 changes: 8 additions & 5 deletions Epigrass/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1048,15 +1048,18 @@ def main():


def end_pools():
PO.close()
PO.terminate()
simobj.PO.close()
simobj.PO.terminate()
# PO.close()
# PO.terminate()
# simobj.PO.close()
# simobj.PO.terminate()

# kill all subprocesses
os.killpg(os.getpid(), signal.SIGTERM)


PO = multiprocessing.Pool()
if __name__ == '__main__':
import atexit
import atexit, signal

atexit.register(end_pools)
main()
Loading

0 comments on commit 3a46457

Please sign in to comment.