Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matplotlib 3.4.1 compatibility #4886

Closed
bnavigator opened this issue Apr 9, 2021 · 3 comments
Closed

Matplotlib 3.4.1 compatibility #4886

bnavigator opened this issue Apr 9, 2021 · 3 comments
Labels
type: bug Something isn't correct or isn't working

Comments

@bnavigator
Copy link

#4878 is unfortunatly not enough. The following tests fail:

[  615s] =================================== FAILURES ===================================
[  615s] ___________________ TestErrorBarPlot.test_errorbars_color_op ___________________
[  615s] 
[  615s] self = ErrorPlot(apply_extents=True, apply_ranges=True, apply_ticks=True, aspect='square', bgcolor=None, cbar_extend=None, cb...nan), yrotation=None, yticks=None, zaxis=True, zformatter=None, zlabel=None, zlim=(nan, nan), zrotation=0, zticks=None)
[  615s] ranges = OrderedDict([('x', {'data': (0.0, 0.0), 'hard': (nan, nan), 'soft': (nan, nan), 'combined': (0.0, 0.0), 'robust': (nan...#000000', '#FF0000', '#00FF00'], dtype=object)]}, 'factors': array(['#000000', '#FF0000', '#00FF00'], dtype=object)})])
...
[  615s]         plot_data, plot_kwargs, axis_kwargs = self.get_data(element, ranges, style)
[  615s]     
[  615s]         with abbreviated_exception():
[  615s] >           handles = self.init_artists(ax, plot_data, plot_kwargs)
...
[  615s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[  615s] 
[  615s] kwargs = {'color': array(['#000000', '#FF0000', '#00FF00'], dtype=object)}
[  615s] k = 'color', v = array(['#000000', '#FF0000', '#00FF00'], dtype=object)
[  615s] 
[  615s]     def _check_color_like(**kwargs):
[  615s]         """
[  615s]         For each *key, value* pair in *kwargs*, check that *value* is color-like.
[  615s]         """
[  615s]         for k, v in kwargs.items():
[  615s]             if not is_color_like(v):
[  615s] >               raise ValueError(f"{v!r} is not a valid value for {k}")
[  615s] E               ValueError: array(['#000000', '#FF0000', '#00FF00'], dtype=object) is not a valid value for color
[  615s] 
[  615s] /usr/lib64/python3.8/site-packages/matplotlib/colors.py:156: ValueError
[  615s] 
[  615s] During handling of the above exception, another exception occurred:
[  615s] 
[  615s] self = <holoviews.tests.plotting.matplotlib.testerrorbarplot.TestErrorBarPlot testMethod=test_errorbars_color_op>
[  615s] 
[  615s]     def test_errorbars_color_op(self):
[  615s]         errorbars = ErrorBars([(0, 0, 0.1, 0.2, '#000000'), (0, 1, 0.2, 0.4, '#FF0000'), (0, 2, 0.6, 1.2, '#00FF00')],
[  615s]                               vdims=['y', 'perr', 'nerr', 'color']).options(color='color')
[  615s] >       plot = mpl_renderer.get_plot(errorbars)
[  615s] 
[  615s] holoviews/tests/plotting/matplotlib/testerrorbarplot.py:19: 
[  615s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[  615s] holoviews/plotting/renderer.py:243: in get_plot
[  615s]     plot.update(init_key)
[  615s] holoviews/plotting/mpl/plot.py:251: in update
[  615s]     return self.initialize_plot()
[  615s] holoviews/plotting/mpl/plot.py:47: in wrapper
[  615s]     return f(self, *args, **kwargs)
[  615s] holoviews/plotting/mpl/element.py:517: in initialize_plot
[  615s]     handles = self.init_artists(ax, plot_data, plot_kwargs)
[  615s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[  615s] 
[  615s] self = <holoviews.core.options.abbreviated_exception object at 0x7efc85b03160>
[  615s] etype = <class 'ValueError'>
[  615s] value = ValueError("array(['#000000', '#FF0000', '#00FF00'], dtype=object) is not a valid value for color")
[  615s] traceback = <traceback object at 0x7efc86305440>
[  615s] 
[  615s]     def __exit__(self, etype, value, traceback):
[  615s]         if isinstance(value, Exception):
[  615s] >           raise AbbreviatedException(etype, value, traceback)
[  615s] E           holoviews.core.options.AbbreviatedException: ValueError: array(['#000000', '#FF0000', '#00FF00'], dtype=object) is not a valid value for color
[  615s] E           
[  615s] E           To view the original traceback, catch this exception and call print_traceback() method.
[  615s] 
[  615s] holoviews/core/options.py:227: AbbreviatedException
...
[  616s] __________________ TestMplGraphPlot.test_graph_op_node_alpha ___________________
[  616s] 
[  616s] self = <holoviews.tests.plotting.matplotlib.testgraphplot.TestMplGraphPlot testMethod=test_graph_op_node_alpha>
[  616s] 
[  616s]     def test_graph_op_node_alpha(self):
[  616s]         edges = [(0, 1), (0, 2)]
[  616s]         nodes = Nodes([(0, 0, 0, 0.2), (0, 1, 1, 0.6), (1, 1, 2, 1)], vdims='alpha')
[  616s]         graph = Graph((edges, nodes)).options(node_alpha='alpha')
[  616s]         with self.assertRaises(Exception):
[  616s] >           mpl_renderer.get_plot(graph)
[  616s] E           AssertionError: Exception not raised
[  616s] 
[  616s] holoviews/tests/plotting/matplotlib/testgraphplot.py:207: AssertionError
[  616s] ________________ TestMplTriMeshPlot.test_trimesh_op_node_alpha _________________
[  616s] 
[  616s] self = <holoviews.tests.plotting.matplotlib.testgraphplot.TestMplTriMeshPlot testMethod=test_trimesh_op_node_alpha>
[  616s] 
[  616s]     def test_trimesh_op_node_alpha(self):
[  616s]         edges = [(0, 1, 2), (1, 2, 3)]
[  616s]         nodes = [(-1, -1, 0, 0.2), (0, 0, 1, 0.6), (0, 1, 2, 1), (1, 0, 3, 0.3)]
[  616s]         trimesh = TriMesh((edges, Nodes(nodes, vdims='alpha'))).options(node_alpha='alpha')
[  616s]         with self.assertRaises(Exception):
[  616s] >           mpl_renderer.get_plot(trimesh)
[  616s] E           AssertionError: Exception not raised
[  616s] 
[  616s] holoviews/tests/plotting/matplotlib/testgraphplot.py:392: AssertionError
...
[  616s] =========================== short test summary info ============================
[  616s] FAILED holoviews/tests/plotting/matplotlib/testerrorbarplot.py::TestErrorBarPlot::test_errorbars_color_op
[  616s] FAILED holoviews/tests/plotting/matplotlib/testerrorbarplot.py::TestErrorBarPlot::test_errorbars_color_op_update
[  616s] FAILED holoviews/tests/plotting/matplotlib/testgraphplot.py::TestMplGraphPlot::test_graph_op_node_alpha
[  616s] FAILED holoviews/tests/plotting/matplotlib/testgraphplot.py::TestMplTriMeshPlot::test_trimesh_op_node_alpha

Full buildlog:
holoviews_mpl3.4.1_log.txt

  • holoviews 1.14.3
  • matplotlib 3.4.1

https://matplotlib.org/stable/users/whats_new.html#colors-and-colormaps

Passing with mpl 3.3.4: holowviews-mpl3.3.txt

@philippjfr
Copy link
Member

Thanks for reporting this. Guess we'll be releasing 1.14.4 very soon.

@hoxbro
Copy link
Member

hoxbro commented May 17, 2021

I'm pretty sure I fixed this in #4860

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't correct or isn't working
Projects
None yet
Development

No branches or pull requests

3 participants