Skip to content

Commit f5b15d6

Browse files
committed
Removing xfails on tests wip
1 parent d4c351b commit f5b15d6

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

glue_jupyter/bqplot/scatter/layer_artist.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def __init__(self, view, viewer_state, layer_state=None, layer=None):
116116

117117
lines_gl_cls = LinesGL
118118
self.line_mark_gl = lines_gl_cls(scales=self.view.scales, x=[0.], y=[0.])
119-
self.line_mark_gl.colors = [color2hex(self.state.color)]
119+
self.line_mark_gl.color = [color2hex(self.state.color)]
120120
self.line_mark_gl.opacities = [self.state.alpha]
121121

122122
# duplicate lines using base bqplot.Lines for linestyle default visible=False
@@ -147,7 +147,7 @@ def __init__(self, view, viewer_state, layer_state=None, layer=None):
147147

148148
vector_lines_cls = bqplot.Lines
149149
self.vector_lines = vector_lines_cls(scales=self.view.scales, x=[0.], y=[0.])
150-
self.vector_lines.colors = [color2hex(self.state.color)]
150+
self.vector_lines.color = [color2hex(self.state.color)]
151151
self.vector_lines.visible = False
152152

153153
# Density map
@@ -257,6 +257,7 @@ def _update_data(self):
257257
self.vector_mark.default_size = int(size * scale * 4)
258258
self.vector_mark.size = length
259259
self.vector_mark.rotation = angle
260+
self.vector_mark.color = [color2hex(self.state.color)]
260261

261262
vector_line_coords = self._build_line_vector_points(x, y, vx, vy)
262263
x_vector_coords = vector_line_coords[:, 0]
@@ -336,7 +337,7 @@ def _update_visual_attributes(self, changed, force=False):
336337

337338
if self.state.line_visible:
338339
if force or "color" in changed:
339-
self.line_mark_gl.colors = [color2hex(self.state.color)]
340+
self.line_mark_gl.color = [color2hex(self.state.color)]
340341
self.line_mark.colors = [color2hex(self.state.color)]
341342
if force or "linewidth" in changed:
342343
self.line_mark_gl.stroke_width = self.state.linewidth
@@ -363,6 +364,8 @@ def _update_visual_attributes(self, changed, force=False):
363364
if force or "color" in changed or "cmap_mode" in changed:
364365
self.vector_mark.color = None
365366
self.vector_mark.colors = [color2hex(self.state.color)]
367+
self.vector_lines.color = None
368+
self.vector_lines.colors = [color2hex(self.state.color)]
366369
elif force or any(prop in changed for prop in CMAP_PROPERTIES):
367370
self.vector_mark.color = ensure_numerical(
368371
self.layer[self.state.cmap_att].ravel(),

glue_jupyter/bqplot/scatter/tests/test_visual.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ def test_visual_scatter2d_density(
7777
return figure
7878

7979

80-
@pytest.mark.xfail
8180
@visual_widget_test
8281
def test_visual_linestyle(
8382
tmp_path,
@@ -107,8 +106,10 @@ def test_visual_linestyle(
107106
scatter.state.layers[0].linestyle = 'solid'
108107
scatter.state.layers[1].line_visible = True
109108
scatter.state.layers[1].linestyle = 'dashed'
109+
scatter.state.layers[1].color = 'r'
110110
scatter.state.layers[2].line_visible = True
111111
scatter.state.layers[2].linestyle = 'dashdot'
112+
scatter.state.layers[2].color = 'b'
112113

113114
assert scatter.layers[0].line_mark_gl.visible
114115
assert not scatter.layers[1].line_mark_gl.visible
@@ -119,7 +120,6 @@ def test_visual_linestyle(
119120
return figure
120121

121122

122-
@pytest.mark.xfail
123123
@visual_widget_test
124124
def test_visual_vector(
125125
tmp_path,

0 commit comments

Comments
 (0)