You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FOR NOW, ADDED AS A HACK TO GETATTR OF PARTICLE MANAGER
# Bypasses a bug (or pyparty design flaw?) in ipython notebook 2.0 beta
# when ending a cell w/ c.particles
if attr == '_ipython_display_':
return
# HACK HACK HACK
if attr == 'circularity':
area = np.array([getattr(p, 'area') for p in self.plist])
perim = np.array([getattr(p, 'perimeter') for p in self.plist])
return 4 * np.pi * ( area / (perim**2) )
return np.array([getattr(p, attr) for p in self.plist])
Maybe not worth it because it's super easy to just define these functions:
def circ(p):
return 4pi * p.area/p.perimeter**2
But still might be worth doing.
The text was updated successfully, but these errors were encountered: