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

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

Merged
merged 1 commit into from Jul 17, 2020

Conversation

rossbar
Copy link
Contributor

@rossbar rossbar commented Jul 17, 2020

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
Copy link
Member

seberg commented Jul 17, 2020

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.

None yet

2 participants