Skip to content

BUG,DOC: Fix bad MPL kwarg in docs#16883

Merged
seberg merged 1 commit into
numpy:masterfrom
rossbar:bug/bad_mpl_kwarg_hist2d
Jul 17, 2020
Merged

BUG,DOC: Fix bad MPL kwarg in docs#16883
seberg merged 1 commit into
numpy:masterfrom
rossbar:bug/bad_mpl_kwarg_hist2d

Conversation

@rossbar

@rossbar rossbar commented Jul 17, 2020

Copy link
Copy Markdown
Contributor

An example in a .. plot directive had an invalid value for the origin parameter of imshow. It seems that input validation was added in matplotlib/matplotlib#16265, causing the numpy documentation build to fail with the following warning:

sphinx error with matplotlib v3.3
WARNING: Exception occurred in plotting numpy-histogram2d-1
 from /home/ross/repos/numpy/doc/source/reference/generated/numpy.histogram2d.rst:
Traceback (most recent call last):
  File "/home/ross/.virtualenvs/numpy-dev/lib/python3.8/site-packages/matplotlib/sphinxext/plot_directive.py", line 472, in run_code
    exec(code, ns)
  File "", line 21, in 
  File "/home/ross/.virtualenvs/numpy-dev/lib/python3.8/site-packages/matplotlib/pyplot.py", line 2707, in imshow
    __ret = gca().imshow(
  File "/home/ross/.virtualenvs/numpy-dev/lib/python3.8/site-packages/matplotlib/__init__.py", line 1431, in inner
    return func(ax, *map(sanitize_sequence, args), **kwargs)
  File "/home/ross/.virtualenvs/numpy-dev/lib/python3.8/site-packages/matplotlib/axes/_axes.py", line 5515, in imshow
    im = mimage.AxesImage(self, cmap, norm, interpolation, origin, extent,
  File "/home/ross/.virtualenvs/numpy-dev/lib/python3.8/site-packages/matplotlib/image.py", line 897, in __init__
    super().__init__(
  File "/home/ross/.virtualenvs/numpy-dev/lib/python3.8/site-packages/matplotlib/image.py", line 247, in __init__
    cbook._check_in_list(["upper", "lower"], origin=origin)
  File "/home/ross/.virtualenvs/numpy-dev/lib/python3.8/site-packages/matplotlib/cbook/__init__.py", line 2248, in _check_in_list
    raise ValueError(
ValueError: 'low' is not a valid value for origin; supported values are 'upper', 'lower'

This is also causing the doc building CI to fail.

Invalide kwarg to imshow causes failures in the plot directive
for docs builds using MPL > v3.3
@seberg

seberg commented Jul 17, 2020

Copy link
Copy Markdown
Member

Thanks for quickly hunting this down Ross!

@seberg seberg merged commit bf10f66 into numpy:master Jul 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants