Skip to content

Commit 5966f92

Browse files
author
Katelyn Begany
committed
corrected ArithmeticError typo, added another ArithmeticError instance
1 parent dbb0add commit 5966f92

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

brainx/modularity.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def _edge_info(self, mod_e=None, mod_a=None, index=None):
156156
mod_e[m] = perc_within #all of the E's
157157
mod_a[m] = perc_btwn+perc_within #all of the A's
158158
if np.isnan(mod_e[m]) or np.isnan(mod_a[m]):
159-
raise ArithmaticError('NAN found: mod_e=%s, mod_a=%s'%(mod_e[m], mod_a[m]))
159+
raise ArithmeticError('NAN found: mod_e=%s, mod_a=%s'%(mod_e[m], mod_a[m]))
160160

161161
return mod_e, mod_a
162162

@@ -172,7 +172,7 @@ def modularity_newman(self):
172172
mod = modularity
173173
"""
174174
if np.isnan((np.array(self.mod_e) - (np.array(self.mod_a)**2)).sum()):
175-
1/0
175+
raise ArithmeticError('NAN found: mod_e=%s, mod_a=%s'%(mod_e[m], mod_a[m]))
176176
return (np.array(self.mod_e) - (np.array(self.mod_a)**2)).sum()
177177

178178
##TODO can we remove this?? CM

0 commit comments

Comments
 (0)