@@ -77,12 +77,8 @@ def test_change_thickness():
77
77
78
78
@pytest .mark .parametrize ("graphic_type" , ["line" , "scatter" ])
79
79
@pytest .mark .parametrize ("colors" , [None , * generate_color_inputs ("b" )])
80
- @pytest .mark .parametrize (
81
- "uniform_color" , [True , False ]
82
- )
83
- @pytest .mark .parametrize (
84
- "alpha" , [1.0 , 0.5 , 0.0 ]
85
- )
80
+ @pytest .mark .parametrize ("uniform_color" , [True , False ])
81
+ @pytest .mark .parametrize ("alpha" , [1.0 , 0.5 , 0.0 ])
86
82
def test_uniform_color (graphic_type , colors , uniform_color , alpha ):
87
83
fig = fpl .Figure ()
88
84
@@ -110,20 +106,29 @@ def test_uniform_color(graphic_type, colors, uniform_color, alpha):
110
106
assert graphic .colors == pygfx .Color ([0 , 0 , 1 , alpha ])
111
107
112
108
# check pygfx material
113
- npt .assert_almost_equal (graphic .world_object .material .color , np .asarray (graphic .colors ))
109
+ npt .assert_almost_equal (
110
+ graphic .world_object .material .color , np .asarray (graphic .colors )
111
+ )
114
112
else :
115
113
assert isinstance (graphic ._colors , VertexColors )
116
114
assert isinstance (graphic .colors , VertexColors )
117
115
if colors is None :
118
116
# default white
119
- npt .assert_almost_equal (graphic .colors .value ,
120
- np .repeat ([[1 , 1 , 1 , alpha ]], repeats = len (graphic .data ), axis = 0 ))
117
+ npt .assert_almost_equal (
118
+ graphic .colors .value ,
119
+ np .repeat ([[1 , 1 , 1 , alpha ]], repeats = len (graphic .data ), axis = 0 ),
120
+ )
121
121
else :
122
122
# blue
123
- npt .assert_almost_equal (graphic .colors .value , np .repeat ([[0 , 0 , 1 , alpha ]], repeats = len (graphic .data ), axis = 0 ))
123
+ npt .assert_almost_equal (
124
+ graphic .colors .value ,
125
+ np .repeat ([[0 , 0 , 1 , alpha ]], repeats = len (graphic .data ), axis = 0 ),
126
+ )
124
127
125
128
# check geometry
126
- npt .assert_almost_equal (graphic .world_object .geometry .colors .data , graphic .colors .value )
129
+ npt .assert_almost_equal (
130
+ graphic .world_object .geometry .colors .data , graphic .colors .value
131
+ )
127
132
128
133
129
134
def test_uniform_size ():
@@ -272,7 +277,9 @@ def test_cmap(
272
277
273
278
@pytest .mark .parametrize ("graphic_type" , ["line" , "scatter" ])
274
279
@pytest .mark .parametrize ("cmap" , ["jet" ])
275
- @pytest .mark .parametrize ("colors" , [None , * generate_color_inputs ("multi" )]) # cmap arg overrides colors
280
+ @pytest .mark .parametrize (
281
+ "colors" , [None , * generate_color_inputs ("multi" )]
282
+ ) # cmap arg overrides colors
276
283
@pytest .mark .parametrize (
277
284
"uniform_color" , [True ] # none of these will work with a uniform buffer
278
285
)
0 commit comments