Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fd69945

Browse files
committed
Merge branch 'master' into fallbackto
2 parents f79e4fe + 781991d commit fd69945

35 files changed

+374
-297
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,4 +209,4 @@ after_success:
209209
- lcov --remove coverage.info --output-file coverage.info '/usr/*' '/home/travis/build/matplotlib/matplotlib/build/*' '/home/travis/build/matplotlib/matplotlib/extern/*' # filter system-files
210210
- lcov --list coverage.info
211211
# Uploading to CodeCov but excluding gcov reports
212-
- bash <(curl -s https://codecov.io/bash) -f "!*.gcov" -X gcov -e TRAVIS_PYTHON_VERSION|| echo "Codecov did not collect coverage reports"
212+
- bash <(curl -s https://codecov.io/bash) -f "!*.gcov" -X gcov -e TRAVIS_PYTHON_VERSION -y ci/codecov.yml|| echo "Codecov did not collect coverage reports"

azure-pipelines.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ steps:
110110
[[ "$PYTHON_VERSION" = 'Pre' ]]
111111
displayName: 'pytest'
112112

113+
- bash: |
114+
bash <(curl -s https://codecov.io/bash) -f "!*.gcov" -X gcov -y ci/codecov.yml
115+
displayName: 'Upload to codecov.io'
116+
113117
- task: PublishTestResults@2
114118
inputs:
115119
testResultsFiles: '**/test-results.xml'

ci/codecov.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# codecov can find this file anywhere in the repo, so we don't need to clutter
2-
# the root folder.
1+
# codecov used to be able to find this anywhere, now we have to manually
2+
# tell it where to look
33
comment: false
44

55
codecov:

doc/api/next_api_changes/behaviour.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,11 @@ Previously, rcParams entries whose values were color-like accepted "spurious"
8585
extra letters or characters in the "middle" of the string, e.g. ``"(0, 1a, '0.5')"``
8686
would be interpreted as ``(0, 1, 0.5)``. These extra characters (including the
8787
internal quotes) now cause a ValueError to be raised.
88+
89+
`.SymLogNorm` now has a *base* parameter
90+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
91+
92+
Previously, `.SymLogNorm` had no *base* kwarg, and defaulted to ``base=np.e``
93+
whereas the documentation said it was ``base=10``. In preparation to make
94+
the default 10, calling `.SymLogNorm` without the new *base* kwarg emits a
95+
deprecation warning.

doc/api/next_api_changes/deprecations.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,3 +211,15 @@ The *clear_temp* parameter and attribute of `.FileMovieWriter` is
211211
deprecated. In the future, files placed in a temporary directory (using
212212
``frame_prefix=None``, the default) will be cleared; files placed elsewhere
213213
will not.
214+
215+
Deprecated rcParams validators
216+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
217+
The following validators, defined in `.rcsetup`, are deprecated:
218+
``validate_fontset``, ``validate_mathtext_default``, ``validate_alignment``,
219+
``validate_svg_fontset``, ``validate_pgf_texsystem``,
220+
``validate_movie_frame_fmt``, ``validate_axis_locator``,
221+
``validate_movie_html_fmt``, ``validate_grid_axis``,
222+
``validate_axes_titlelocation``, ``validate_toolbar``,
223+
``validate_ps_papersize``, ``validate_legend_log``. To test whether an rcParam
224+
value would be acceptable, one can test e.g. ``rc = RcParams(); rc[k] = v``
225+
raises an exception.

doc/devel/coding_guide.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ When making a PR, pay attention to:
3232
feedback from the developers. You may mark these as
3333
`draft pull requests <https://help.github.com/en/articles/about-pull-requests#draft-pull-requests>`_
3434
on GitHub.
35+
* When updating your PR, instead of adding new commits to fix something, please
36+
consider amending your initial commit(s) to keep the history clean.
37+
You can achieve this using::
38+
39+
git commit --amend --no-edit
40+
git push [your-remote-repo] [your-branch] --force-with-lease
3541

3642
See also :ref:`contributing` for how to make a PR.
3743

examples/userdemo/colormap_normalizations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969

7070
pcm = ax[0].pcolormesh(X, Y, Z1,
7171
norm=colors.SymLogNorm(linthresh=0.03, linscale=0.03,
72-
vmin=-1.0, vmax=1.0),
72+
vmin=-1.0, vmax=1.0, base=10),
7373
cmap='RdBu_r')
7474
fig.colorbar(pcm, ax=ax[0], extend='both')
7575

examples/userdemo/colormap_normalizations_symlognorm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
pcm = ax[0].pcolormesh(X, Y, Z,
3131
norm=colors.SymLogNorm(linthresh=0.03, linscale=0.03,
32-
vmin=-1.0, vmax=1.0),
32+
vmin=-1.0, vmax=1.0, base=10),
3333
cmap='RdBu_r')
3434
fig.colorbar(pcm, ax=ax[0], extend='both')
3535

lib/matplotlib/animation.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1577,8 +1577,10 @@ def init_func() -> iterable_of_artists
15771577
fargs : tuple or None, optional
15781578
Additional arguments to pass to each call to *func*.
15791579
1580-
save_count : int, optional
1581-
The number of values from *frames* to cache.
1580+
save_count : int, default: 100
1581+
Fallback for the number of values from *frames* to cache. This is
1582+
only used if the number of frames cannot be inferred from *frames*,
1583+
i.e. when it's an iterator without length or a generator.
15821584
15831585
interval : int, default: 200
15841586
Delay between frames in milliseconds.

lib/matplotlib/artist.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
import numpy as np
1010

11-
import matplotlib
12-
from . import cbook, docstring, rcParams
11+
import matplotlib as mpl
12+
from . import cbook, docstring
1313
from .path import Path
1414
from .transforms import (Bbox, IdentityTransform, Transform, TransformedBbox,
1515
TransformedPatchPath, TransformedPath)
@@ -99,8 +99,8 @@ def __init__(self):
9999
self._url = None
100100
self._gid = None
101101
self._snap = None
102-
self._sketch = rcParams['path.sketch']
103-
self._path_effects = rcParams['path.effects']
102+
self._sketch = mpl.rcParams['path.sketch']
103+
self._path_effects = mpl.rcParams['path.effects']
104104
self._sticky_edges = _XYPair([], [])
105105
self._in_layout = True
106106

@@ -588,7 +588,7 @@ def get_snap(self):
588588
589589
See `.set_snap` for details.
590590
"""
591-
if rcParams['path.snap']:
591+
if mpl.rcParams['path.snap']:
592592
return self._snap
593593
else:
594594
return False
@@ -1602,7 +1602,7 @@ def kwdoc(artist):
16021602
"""
16031603
ai = ArtistInspector(artist)
16041604
return ('\n'.join(ai.pprint_setters_rest(leadingspace=4))
1605-
if matplotlib.rcParams['docstring.hardcopy'] else
1605+
if mpl.rcParams['docstring.hardcopy'] else
16061606
'Properties:\n' + '\n'.join(ai.pprint_setters(leadingspace=4)))
16071607

16081608

lib/matplotlib/axis.py

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import numpy as np
99

10-
from matplotlib import rcParams
10+
import matplotlib as mpl
1111
import matplotlib.artist as martist
1212
import matplotlib.cbook as cbook
1313
import matplotlib.lines as mlines
@@ -84,11 +84,12 @@ def __init__(self, axes, loc, label=None,
8484
martist.Artist.__init__(self)
8585

8686
if gridOn is None:
87-
if major and (rcParams['axes.grid.which'] in ('both', 'major')):
88-
gridOn = rcParams['axes.grid']
89-
elif (not major) and (rcParams['axes.grid.which']
87+
if major and (mpl.rcParams['axes.grid.which']
88+
in ('both', 'major')):
89+
gridOn = mpl.rcParams['axes.grid']
90+
elif (not major) and (mpl.rcParams['axes.grid.which']
9091
in ('both', 'minor')):
91-
gridOn = rcParams['axes.grid']
92+
gridOn = mpl.rcParams['axes.grid']
9293
else:
9394
gridOn = False
9495

@@ -102,25 +103,25 @@ def __init__(self, axes, loc, label=None,
102103
major_minor = "major" if major else "minor"
103104

104105
if size is None:
105-
size = rcParams[f"{name}.{major_minor}.size"]
106+
size = mpl.rcParams[f"{name}.{major_minor}.size"]
106107
self._size = size
107108

108109
if width is None:
109-
width = rcParams[f"{name}.{major_minor}.width"]
110+
width = mpl.rcParams[f"{name}.{major_minor}.width"]
110111
self._width = width
111112

112113
if color is None:
113-
color = rcParams[f"{name}.color"]
114+
color = mpl.rcParams[f"{name}.color"]
114115

115116
if pad is None:
116-
pad = rcParams[f"{name}.{major_minor}.pad"]
117+
pad = mpl.rcParams[f"{name}.{major_minor}.pad"]
117118
self._base_pad = pad
118119

119120
if labelcolor is None:
120-
labelcolor = rcParams[f"{name}.color"]
121+
labelcolor = mpl.rcParams[f"{name}.color"]
121122

122123
if labelsize is None:
123-
labelsize = rcParams[f"{name}.labelsize"]
124+
labelsize = mpl.rcParams[f"{name}.labelsize"]
124125

125126
self._set_labelrotation(labelrotation)
126127

@@ -132,13 +133,13 @@ def __init__(self, axes, loc, label=None,
132133
self._zorder = zorder
133134

134135
if grid_color is None:
135-
grid_color = rcParams["grid.color"]
136+
grid_color = mpl.rcParams["grid.color"]
136137
if grid_linestyle is None:
137-
grid_linestyle = rcParams["grid.linestyle"]
138+
grid_linestyle = mpl.rcParams["grid.linestyle"]
138139
if grid_linewidth is None:
139-
grid_linewidth = rcParams["grid.linewidth"]
140+
grid_linewidth = mpl.rcParams["grid.linewidth"]
140141
if grid_alpha is None:
141-
grid_alpha = rcParams["grid.alpha"]
142+
grid_alpha = mpl.rcParams["grid.alpha"]
142143
grid_kw = {k[5:]: v for k, v in kw.items()}
143144

144145
self.apply_tickdir(tickdir)
@@ -453,7 +454,7 @@ def _get_text2_transform(self):
453454

454455
def apply_tickdir(self, tickdir):
455456
if tickdir is None:
456-
tickdir = rcParams['%s.direction' % self.__name__.lower()]
457+
tickdir = mpl.rcParams['%s.direction' % self.__name__.lower()]
457458
self._tickdir = tickdir
458459

459460
if self._tickdir == 'in':
@@ -524,7 +525,7 @@ def _get_text2_transform(self):
524525

525526
def apply_tickdir(self, tickdir):
526527
if tickdir is None:
527-
tickdir = rcParams['%s.direction' % self.__name__.lower()]
528+
tickdir = mpl.rcParams['%s.direction' % self.__name__.lower()]
528529
self._tickdir = tickdir
529530

530531
if self._tickdir == 'in':
@@ -689,15 +690,15 @@ def __init__(self, axes, pickradius=15):
689690

690691
self.label = mtext.Text(
691692
np.nan, np.nan,
692-
fontsize=rcParams['axes.labelsize'],
693-
fontweight=rcParams['axes.labelweight'],
694-
color=rcParams['axes.labelcolor'],
693+
fontsize=mpl.rcParams['axes.labelsize'],
694+
fontweight=mpl.rcParams['axes.labelweight'],
695+
color=mpl.rcParams['axes.labelcolor'],
695696
)
696697
self._set_artist_props(self.label)
697698
self.offsetText = mtext.Text(np.nan, np.nan)
698699
self._set_artist_props(self.offsetText)
699700

700-
self.labelpad = rcParams['axes.labelpad']
701+
self.labelpad = mpl.rcParams['axes.labelpad']
701702

702703
self.pickradius = pickradius
703704

@@ -778,10 +779,12 @@ def cla(self):
778779
self.callbacks = cbook.CallbackRegistry()
779780

780781
# whether the grids are on
781-
self._gridOnMajor = (rcParams['axes.grid'] and
782-
rcParams['axes.grid.which'] in ('both', 'major'))
783-
self._gridOnMinor = (rcParams['axes.grid'] and
784-
rcParams['axes.grid.which'] in ('both', 'minor'))
782+
self._gridOnMajor = (
783+
mpl.rcParams['axes.grid'] and
784+
mpl.rcParams['axes.grid.which'] in ('both', 'major'))
785+
self._gridOnMinor = (
786+
mpl.rcParams['axes.grid'] and
787+
mpl.rcParams['axes.grid.which'] in ('both', 'minor'))
785788

786789
self.reset_ticks()
787790

@@ -1842,8 +1845,8 @@ def __init__(self, *args, **kwargs):
18421845
verticalalignment='top', horizontalalignment='right',
18431846
transform=mtransforms.blended_transform_factory(
18441847
self.axes.transAxes, mtransforms.IdentityTransform()),
1845-
fontsize=rcParams['xtick.labelsize'],
1846-
color=rcParams['xtick.color'],
1848+
fontsize=mpl.rcParams['xtick.labelsize'],
1849+
color=mpl.rcParams['xtick.color'],
18471850
)
18481851
self.offset_text_position = 'bottom'
18491852

@@ -2135,8 +2138,8 @@ def __init__(self, *args, **kwargs):
21352138
verticalalignment='baseline', horizontalalignment='left',
21362139
transform=mtransforms.blended_transform_factory(
21372140
self.axes.transAxes, mtransforms.IdentityTransform()),
2138-
fontsize=rcParams['ytick.labelsize'],
2139-
color=rcParams['ytick.color'],
2141+
fontsize=mpl.rcParams['ytick.labelsize'],
2142+
color=mpl.rcParams['ytick.color'],
21402143
)
21412144
self.offset_text_position = 'left'
21422145

0 commit comments

Comments
 (0)