@@ -546,10 +546,6 @@ def test_get_column_proper_view(self):
546546 np .testing .assert_equal (col , data .X [:, 0 ])
547547 self .assertIs (col .base , data .X )
548548
549- col = data .get_column (y , view = True )
550- np .testing .assert_equal (col , data .X [:, 0 ])
551- self .assertIs (col .base , data .X )
552-
553549 col = data .get_column (y , copy = True )
554550 np .testing .assert_equal (col , data .X [:, 0 ])
555551 self .assertIsNone (col .base )
@@ -565,31 +561,20 @@ def test_get_column_computed(self):
565561 np .testing .assert_equal (col2 , [2 , 4 , 6 ])
566562 self .assertIsNone (col2 .base )
567563
568- self .assertRaises (ValueError , data .get_column , y2 , view = True )
569-
570- def test_get_column_wrong_arguments (self ):
571- self .assertRaises (
572- ValueError , self .data .get_column , self .data .domain ["y" ],
573- copy = True , view = True )
574-
575564 def test_get_column_discrete (self ):
576565 data , d = self .data , self .data .domain ["d" ]
577566
578567 col = data .get_column (d )
579568 np .testing .assert_equal (col , [0 , 0 , 1 ])
580569 self .assertIs (col .base , data .X )
581570
582- col = data .get_column (d , view = True )
583- np .testing .assert_equal (col , [0 , 0 , 1 ])
584- self .assertIs (col .base , data .X )
585-
586571 col = data .get_column (d , copy = True )
587572 np .testing .assert_equal (col , [0 , 0 , 1 ])
588573 self .assertIsNone (col .base )
589574
590575 e = DiscreteVariable ("d" , values = ("a" , "b" ))
591576 assert e == d
592- col = data .get_column (e , view = True )
577+ col = data .get_column (e )
593578 np .testing .assert_equal (col , [0 , 0 , 1 ])
594579 self .assertIs (col .base , data .X )
595580
@@ -603,10 +588,6 @@ def test_get_column_discrete(self):
603588 col = data .get_column (e )
604589 np .testing .assert_equal (col , [0 , 0 , 2 ])
605590
606- e = DiscreteVariable ("d" , values = ("a" , "b" , "c" ))
607- assert e == d # because that's how Variable mapping works
608- self .assertRaises (ValueError , data .get_column , e , view = True )
609-
610591 with data .unlocked (data .X ):
611592 data .X = sp .csr_matrix (data .X )
612593 e = DiscreteVariable ("d" , values = ("a" , "c" , "b" ))
@@ -625,19 +606,11 @@ def test_sparse(self):
625606 self .assertFalse (sp .issparse (col ))
626607 np .testing .assert_equal (col , orig_y )
627608
628- self .assertRaises (ValueError , data .get_column , y , view = True )
629-
630609 col = data .get_column (y , copy = True )
631610 self .assertFalse (sp .issparse (col ))
632611 np .testing .assert_equal (col , orig_y )
633612
634613 def test_get_column_no_variable (self ):
635- self .assertRaises (ValueError , self .data .get_column ,
636- ContinuousVariable ("y3" ), view = True )
637-
638- self .assertRaises (ValueError , self .data .get_column ,
639- ContinuousVariable ("y3" ), copy = True )
640-
641614 self .assertRaises (ValueError , self .data .get_column ,
642615 ContinuousVariable ("y3" ))
643616
@@ -648,10 +621,6 @@ def test_index_by_int(self):
648621 np .testing .assert_equal (col , data .X [:, 0 ])
649622 self .assertIs (col .base , data .X )
650623
651- col = data .get_column (0 , view = True )
652- np .testing .assert_equal (col , data .X [:, 0 ])
653- self .assertIs (col .base , data .X )
654-
655624 col = data .get_column (0 , copy = True )
656625 np .testing .assert_equal (col , data .X [:, 0 ])
657626 self .assertIsNone (col .base )
@@ -671,10 +640,6 @@ def test_index_by_int(self):
671640 np .testing .assert_equal (col , data .X [:, 0 ])
672641 self .assertIs (col .base , data .X )
673642
674- col = data .get_column ("y" , view = True )
675- np .testing .assert_equal (col , data .X [:, 0 ])
676- self .assertIs (col .base , data .X )
677-
678643 col = data .get_column ("y" , copy = True )
679644 np .testing .assert_equal (col , data .X [:, 0 ])
680645 self .assertIsNone (col .base )
0 commit comments