Skip to content

Commit 3831542

Browse files
authored
Merge pull request #12129 from tacaswell/backport_12128
Backports for 3.0
2 parents a9402c0 + 9fb90d4 commit 3831542

File tree

13 files changed

+82
-306
lines changed

13 files changed

+82
-306
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ exclude =
2323

2424
per-file-ignores =
2525
setup.py: E402
26-
setupext.py: E302, E501
26+
setupext.py: E501
2727

2828
tools/compare_backend_driver_results.py: E501
2929
tools/subset.py: E221, E231, E251, E261, E302, E501, E701

doc-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Install the documentation requirements with:
77
# pip install -r doc-requirements.txt
88
#
9-
sphinx>=1.3,!=1.5.0,!=1.6.4,!=1.7.3,<1.8
9+
sphinx>=1.3,!=1.5.0,!=1.6.4,!=1.7.3
1010
colorspacious
1111
ipython
1212
ipywidgets

doc/conf.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ def _check_deps():
8484
autosummary_generate = True
8585

8686
autodoc_docstring_signature = True
87-
autodoc_default_flags = ['members', 'undoc-members']
87+
if sphinx.version_info < (1, 8):
88+
autodoc_default_flags = ['members', 'undoc-members']
89+
else:
90+
autodoc_default_options = {'members': None, 'undoc-members': None}
8891

8992
intersphinx_mapping = {
9093
'python': ('https://docs.python.org/3', None),

doc/sphinxext/github.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ def ghissue_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
7575
prb = inliner.problematic(rawtext, rawtext, msg)
7676
return [prb], [msg]
7777
app = inliner.document.settings.env.app
78-
#app.info('issue %r' % text)
7978
if 'pull' in name.lower():
8079
category = 'pull'
8180
elif 'issue' in name.lower():
@@ -105,7 +104,6 @@ def ghuser_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
105104
:param content: The directive content for customization.
106105
"""
107106
app = inliner.document.settings.env.app
108-
#app.info('user link %r' % text)
109107
ref = 'https://www.github.com/' + text
110108
node = nodes.reference(rawtext, text, refuri=ref, **options)
111109
return [node], []
@@ -126,7 +124,6 @@ def ghcommit_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
126124
:param content: The directive content for customization.
127125
"""
128126
app = inliner.document.settings.env.app
129-
#app.info('user link %r' % text)
130127
try:
131128
base = app.config.github_project_url
132129
if not base:
@@ -146,7 +143,6 @@ def setup(app):
146143
147144
:param app: Sphinx application context.
148145
"""
149-
app.info('Initializing GitHub plugin')
150146
app.add_role('ghissue', ghissue_role)
151147
app.add_role('ghpull', ghissue_role)
152148
app.add_role('ghuser', ghuser_role)

doc/users/next_whats_new/2018-09-06-AL.rst

Lines changed: 0 additions & 12 deletions
This file was deleted.

doc/users/whats_new.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,29 @@ Headless linux servers (identified by the DISPLAY env not being defined)
239239
will not select a GUI backend.
240240

241241

242+
Return type of ArtistInspector.get_aliases changed
243+
``````````````````````````````````````````````````
244+
245+
`ArtistInspector.get_aliases` previously returned the set of aliases as
246+
``{fullname: {alias1: None, alias2: None, ...}}``. The dict-to-None mapping
247+
was used to simulate a set in earlier versions of Python. It has now been
248+
replaced by a set, i.e. ``{fullname: {alias1, alias2, ...}}``.
249+
250+
This value is also stored in `ArtistInspector.aliasd`, which has likewise
251+
changed.
252+
253+
254+
``:math:`` directive renamed to ``:mathmpl:``
255+
`````````````````````````````````````````````
256+
257+
The ``:math:`` rst role provided by `matplotlib.sphinxext.mathmpl` has been
258+
renamed to ``:mathmpl:`` to avoid conflicting with the ``:math:`` role that
259+
Sphinx 1.8 provides by default. (``:mathmpl:`` uses Matplotlib to render math
260+
expressions to images embedded in html, whereas Sphinx uses MathJax.)
261+
262+
When using Sphinx<1.8, both names (``:math:`` and ``:mathmpl:``) remain
263+
available for backcompatibility.
264+
242265

243266
==================
244267
Previous Whats New

lib/matplotlib/colorbar.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,8 @@ def __call__(self):
267267
vmin = self._colorbar.norm.vmin
268268
vmax = self._colorbar.norm.vmax
269269
ticks = ticker.AutoMinorLocator.__call__(self)
270-
return ticks[(ticks >= vmin) & (ticks <= vmax)]
270+
rtol = (vmax - vmin) * 1e-10
271+
return ticks[(ticks >= vmin - rtol) & (ticks <= vmax + rtol)]
271272

272273

273274
class _ColorbarLogLocator(ticker.LogLocator):

lib/matplotlib/sphinxext/mathmpl.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
import hashlib
12
import os
23
import sys
3-
from hashlib import md5
4+
import warnings
45

56
from docutils import nodes
67
from docutils.parsers.rst import directives
7-
import warnings
8+
import sphinx
89

910
from matplotlib import rcParams
1011
from matplotlib.mathtext import MathTextParser
@@ -61,7 +62,7 @@ def latex2png(latex, filename, fontset='cm'):
6162
def latex2html(node, source):
6263
inline = isinstance(node.parent, nodes.TextElement)
6364
latex = node['latex']
64-
name = 'math-%s' % md5(latex.encode()).hexdigest()[-10:]
65+
name = 'math-%s' % hashlib.md5(latex.encode()).hexdigest()[-10:]
6566

6667
destdir = os.path.join(setup.app.builder.outdir, '_images', 'mathmpl')
6768
if not os.path.exists(destdir):
@@ -110,9 +111,13 @@ def depart_latex_math_latex(self, node):
110111
app.add_node(latex_math,
111112
html=(visit_latex_math_html, depart_latex_math_html),
112113
latex=(visit_latex_math_latex, depart_latex_math_latex))
113-
app.add_role('math', math_role)
114-
app.add_directive('math', math_directive,
114+
app.add_role('mathmpl', math_role)
115+
app.add_directive('mathmpl', math_directive,
115116
True, (0, 0, 0), **options_spec)
117+
if sphinx.version_info < (1, 8):
118+
app.add_role('math', math_role)
119+
app.add_directive('math', math_directive,
120+
True, (0, 0, 0), **options_spec)
116121

117122
metadata = {'parallel_read_safe': True, 'parallel_write_safe': True}
118123
return metadata

lib/matplotlib/tests/test_colorbar.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,15 @@ def test_colorbar_minorticks_on_off():
294294
np.testing.assert_almost_equal(cbar.ax.yaxis.get_minorticklocs(),
295295
np.array([]))
296296

297+
im.set_clim(vmin=-1.2, vmax=1.2)
298+
cbar.minorticks_on()
299+
correct_minorticklocs = np.array([-1.2, -1.1, -0.9, -0.8, -0.7, -0.6,
300+
-0.4, -0.3, -0.2, -0.1, 0.1, 0.2,
301+
0.3, 0.4, 0.6, 0.7, 0.8, 0.9,
302+
1.1, 1.2])
303+
np.testing.assert_almost_equal(cbar.ax.yaxis.get_minorticklocs(),
304+
correct_minorticklocs)
305+
297306

298307
def test_colorbar_autoticks():
299308
# Test new autotick modes. Needs to be classic because

setup.cfg.template

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,9 @@
6363
# behavior
6464
#
6565
#agg = auto
66-
#cairo = auto
67-
#gtk3agg = auto
68-
#gtk3cairo = auto
6966
#macosx = auto
70-
#pyside = auto
71-
#qt4agg = auto
7267
#tkagg = auto
7368
#windowing = auto
74-
#wxagg = auto
7569

7670
[rc_options]
7771
# User-configurable options
@@ -81,10 +75,9 @@
8175
#
8276
# The Agg, Ps, Pdf and SVG backends do not require external dependencies. Do
8377
# not choose MacOSX, or TkAgg if you have disabled the relevant extension
84-
# modules. Agg will be used by default.
78+
# modules. The default is determined by fallback.
8579
#
8680
#backend = Agg
87-
#
8881

8982
[package_data]
9083
# Package additional files found in the lib/matplotlib directories.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy