Skip to content

Commit ed4513d

Browse files
author
Katelyn Begany
committed
BF: Fix for correct call to check_integrity method, in debug or extra_info mode
1 parent a56c4e8 commit ed4513d

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

brainx/modularity.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,13 +1222,12 @@ def simulated_annealing(g, p0=None, temperature = 50, temp_scaling = 0.995, tmin
12221222
npt.assert_almost_equal(debug_partition.modularity(),
12231223
graph_part_final.modularity(), 11)
12241224

1225-
for mod in graph_part_final.index:
1226-
if len(graph_part_final.index[mod]) < 1:
1227-
empty_module('LAST CHECK: Empty module after module %s,SA' % (movetype))
1225+
debug_partition.check_integrity(graph_part_final.index)
12281226

12291227
if extra_info:
12301228
extra_dict = dict(energy = energy_array, temp = temp_array)
1231-
#return graph_partition, extra_dict
1229+
graph_part_final.check_integrity(graph_part_final.index)
1230+
#return graph_partition, extra_dict
12321231
return graph_part_final, extra_dict
12331232
else:
12341233
#return graph_partition
@@ -1245,9 +1244,8 @@ def simulated_annealing(g, p0=None, temperature = 50, temp_scaling = 0.995, tmin
12451244
if np.abs(finalmodval - (-energy_best)) > 0.000001: #to account for float error
12461245
raise ValueError('mismatch in energy and modularity')
12471246

1248-
check_integrity(graph_part_final)
12491247

1250-
return graph_part_final,graph_part_final.modularity()
1248+
return graph_part_final, graph_part_final.modularity()
12511249

12521250

12531251
def modularity_matrix(g):

0 commit comments

Comments
 (0)