def testIntervalGate(self): verts = array([1.5, 4.5]) cols = [0] g = IntervalGate(verts, cols) self.fcm.gate(g) assert_array_equal(self.fcm.view(), array([[3, 4, 5]]), 'gate excluded wrong points') self.fcm.visit('root') self.fcm.gate(g) nodes = self.fcm.tree.nodes.keys() assert 'g2' in nodes, 'gating name mangled' assert 'g1' in nodes, 'gating name mangled'
def testEmptyIntervalGate(self): verts = array([10.5, 40.5]) cols = [0] g = IntervalGate(verts, cols) self.fcm.gate(g) assert_array_equal( self.fcm.view(), array([]).reshape((0, 3)), 'gate excluded wrong points') self.fcm.gate(g) assert_array_equal( self.fcm.view(), array([]).reshape((0, 3)), 'gate excluded wrong points') nodes = self.fcm.tree.nodes.keys() assert 'g2' in nodes, 'gating name mangled' assert 'g1' in nodes, 'gating name mangled'