@@ -689,47 +689,35 @@ def test_plot_can_handle_nan_values_in_color_data(self, sdata_blobs: SpatialData
689689 """Test that NaN values in color data are handled gracefully."""
690690 sdata_blobs ["table" ].obs ["region" ] = pd .Categorical (["blobs_circles" ] * sdata_blobs ["table" ].n_obs )
691691 sdata_blobs ["table" ].uns ["spatialdata_attrs" ]["region" ] = "blobs_circles"
692-
692+
693693 # Add color column with NaN values
694694 sdata_blobs .shapes ["blobs_circles" ]["color_with_nan" ] = [1.0 , 2.0 , np .nan , 4.0 , 5.0 ]
695-
695+
696696 # Test that rendering works with NaN values and issues warning
697697 with pytest .warns (UserWarning , match = "Found 1 NaN values in color data" ):
698- sdata_blobs .pl .render_shapes (
699- element = "blobs_circles" ,
700- color = "color_with_nan" ,
701- na_color = "red"
702- ).pl .show ()
698+ sdata_blobs .pl .render_shapes (element = "blobs_circles" , color = "color_with_nan" , na_color = "red" ).pl .show ()
703699
704700 def test_plot_colorbar_normalization_with_nan_values (self , sdata_blobs : SpatialData ):
705701 """Test that colorbar normalization works correctly with NaN values."""
706702 sdata_blobs ["table" ].obs ["region" ] = pd .Categorical (["blobs_polygons" ] * sdata_blobs ["table" ].n_obs )
707703 sdata_blobs ["table" ].uns ["spatialdata_attrs" ]["region" ] = "blobs_polygons"
708-
704+
709705 sdata_blobs .shapes ["blobs_polygons" ]["color_with_nan" ] = [1.0 , 2.0 , np .nan , 4.0 , 5.0 ]
710-
706+
711707 # Test colorbar with NaN values - should use nanmin/nanmax
712- sdata_blobs .pl .render_shapes (
713- element = "blobs_polygons" ,
714- color = "color_with_nan" ,
715- na_color = "gray"
716- ).pl .show ()
708+ sdata_blobs .pl .render_shapes (element = "blobs_polygons" , color = "color_with_nan" , na_color = "gray" ).pl .show ()
717709
718710 def test_plot_can_handle_non_numeric_radius_values (self , sdata_blobs : SpatialData ):
719711 """Test that non-numeric radius values are handled gracefully."""
720712 sdata_blobs .shapes ["blobs_circles" ]["radius_mixed" ] = [1.0 , "invalid" , 3.0 , np .nan , 5.0 ]
721-
713+
722714 sdata_blobs .pl .render_shapes (element = "blobs_circles" , color = "red" ).pl .show ()
723715
724716 def test_plot_can_handle_mixed_numeric_and_color_data (self , sdata_blobs : SpatialData ):
725717 """Test handling of mixed numeric and color-like data."""
726718 sdata_blobs ["table" ].obs ["region" ] = pd .Categorical (["blobs_circles" ] * sdata_blobs ["table" ].n_obs )
727719 sdata_blobs ["table" ].uns ["spatialdata_attrs" ]["region" ] = "blobs_circles"
728-
720+
729721 sdata_blobs .shapes ["blobs_circles" ]["mixed_data" ] = [1.0 , 2.0 , np .nan , "red" , 5.0 ]
730-
731- sdata_blobs .pl .render_shapes (
732- element = "blobs_circles" ,
733- color = "mixed_data" ,
734- na_color = "gray"
735- ).pl .show ()
722+
723+ sdata_blobs .pl .render_shapes (element = "blobs_circles" , color = "mixed_data" , na_color = "gray" ).pl .show ()
0 commit comments