@@ -318,8 +318,15 @@ def test_valid_imp_marker_sizes(self):
318
318
imp_marker_sizes = valid_imp_marker_sizes )
319
319
assert isinstance (fig , plt .Figure ) and isinstance (ax , plt .Axes )
320
320
plt .close ()
321
-
322
-
321
+
322
+ def test_valid_add_imp_bar_top (self ):
323
+ cpp_plot = aa .CPPPlot ()
324
+ df_feat = get_df_feat ()
325
+ for add_imp_bar_top in [True , False ]:
326
+ fig , ax = cpp_plot .feature_map (df_feat = df_feat , add_imp_bar_top = add_imp_bar_top )
327
+ assert isinstance (fig , plt .Figure ) and isinstance (ax , plt .Axes )
328
+ plt .close ()
329
+
323
330
def test_valid_imp_bar_th (self ):
324
331
cpp_plot = aa .CPPPlot ()
325
332
df_feat = get_df_feat ()
@@ -328,6 +335,14 @@ def test_valid_imp_bar_th(self):
328
335
assert isinstance (fig , plt .Figure ) and isinstance (ax , plt .Axes )
329
336
plt .close ()
330
337
338
+ def test_valid_imp_bar_label_type (self ):
339
+ cpp_plot = aa .CPPPlot ()
340
+ df_feat = get_df_feat ()
341
+ for imp_bar_label_type in ["short" , "long" , None ]:
342
+ fig , ax = cpp_plot .feature_map (df_feat = df_feat , imp_bar_label_type = imp_bar_label_type )
343
+ assert isinstance (fig , plt .Figure ) and isinstance (ax , plt .Axes )
344
+ plt .close ()
345
+
331
346
@settings (max_examples = 3 , deadline = 5000 )
332
347
@given (xtick_size = st .floats (min_value = 8.0 , max_value = 14.0 ), xtick_width = st .floats (min_value = 0.5 , max_value = 2.0 ),
333
348
xtick_length = st .floats (min_value = 3.0 , max_value = 10.0 ))
@@ -656,6 +671,14 @@ def test_invalid_imp_marker_sizes(self):
656
671
cpp_plot .feature_map (df_feat = df_feat , imp_marker_sizes = invalid_imp_marker_sizes )
657
672
plt .close ()
658
673
674
+ def test_invalid_add_imp_bar_top (self ):
675
+ cpp_plot = aa .CPPPlot ()
676
+ df_feat = get_df_feat ()
677
+ for add_imp_bar_top in [None , "adsf" , 123 , pd .DataFrame , {}]:
678
+ with pytest .raises (ValueError ):
679
+ cpp_plot .feature_map (df_feat = df_feat , add_imp_bar_top = add_imp_bar_top )
680
+ plt .close ()
681
+
659
682
def test_invalid_imp_bar_th (self ):
660
683
cpp_plot = aa .CPPPlot ()
661
684
df_feat = get_df_feat ()
@@ -664,6 +687,14 @@ def test_invalid_imp_bar_th(self):
664
687
cpp_plot .feature_map (df_feat = df_feat , imp_bar_th = invalid_imp_bar_th )
665
688
plt .close ()
666
689
690
+ def test_invalid_imp_bar_label_type (self ):
691
+ cpp_plot = aa .CPPPlot ()
692
+ df_feat = get_df_feat ()
693
+ for imp_bar_label_type in ["adsf" , 123 , pd .DataFrame , {}]:
694
+ with pytest .raises (ValueError ):
695
+ cpp_plot .feature_map (df_feat = df_feat , imp_bar_label_type = imp_bar_label_type )
696
+ plt .close ()
697
+
667
698
@settings (max_examples = 3 , deadline = 5000 )
668
699
@given (xtick_size = st .just (- 1 ), xtick_width = st .just (- 1 ), xtick_length = st .just (- 1 ))
669
700
def test_invalid_tick_styling (self , xtick_size , xtick_width , xtick_length ):
@@ -734,4 +765,4 @@ def test_complex_negative_positive(self):
734
765
xtick_width = - 1 , # Invalid xtick_width
735
766
xtick_length = - 1 , # Invalid xtick_length
736
767
** args_seq )
737
- plt .close ()
768
+ plt .close ()
0 commit comments