Skip to content

Commit

Permalink
update data processing code
Browse files Browse the repository at this point in the history
  • Loading branch information
fredhohman committed Mar 31, 2018
1 parent 1ba5c9a commit 6fa8dfd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
4 changes: 2 additions & 2 deletions data-processing/data-processing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ python process-positions.py -data $1
echo -e '\n'
echo -e '\n'

# echo 'add-vertex-positions.py'
# python add-vertex-positions.py -data $1
# echo 'add-vertex-labels.py'
# python add-vertex-labels.py -data $1
3 changes: 1 addition & 2 deletions data-processing/decomposition-to-graph-layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def getopts(argv):

boundary = 500

# load vertices and positions
# # load vertices and positions
print('loading positions')
positions = pd.io.parsers.read_csv(
'../data/' + args['-data'] + '/' + args['-data'] + '-positions.csv',
Expand Down Expand Up @@ -109,6 +109,5 @@ def getopts(argv):

# save graph as json
print('saving graph layer')
# num_of_leading_zeros = len(str(np.max(peels)))
with open('../data/' + args['-data'] + '/' + args['-data'] + '-layer-' + str(peel) + '.json', 'w') as outfile:
json.dump(graph, outfile)
10 changes: 1 addition & 9 deletions data-processing/gather-statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,10 @@ def getopts(argv):
for j, n in enumerate(cl):
cl[j] = g_layer.vs[n]['id']

# for i, cmpt in enumerate(components2):
# for j, n in enumerate(cmpt):
# cmpt[j] = g_layer.vs[n]['id']

for node in graph_layer['nodes']:
for i, cmpt in enumerate(comp_list):

# for j, n in enumerate(cmpt):
# cmpt[j] = g_layer.vs[n]['id']

if int(node['id']) in cmpt:
node['cmpt'] = i
# print('found')
break

# define layer data
Expand All @@ -135,6 +126,7 @@ def getopts(argv):
data['peels'].append(peel)

# save data as json
print('saving layer data with component ids')
with open(graph_layer_data_path, 'w') as outfile:
json.dump(graph_layer, outfile)

Expand Down

0 comments on commit 6fa8dfd

Please sign in to comment.