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

Skip to content

Commit 1a9b4ee

Browse files
committed
Merge branch 'v2.x'
Conflicts: .travis.yml lib/matplotlib/tests/test_animation.py
2 parents 6ae28a0 + bceea0c commit 1a9b4ee

File tree

9 files changed

+25
-75
lines changed

9 files changed

+25
-75
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ matrix:
6767
env: BUILD_DOCS=true
6868
- python: 3.5
6969
env: USE_PYTEST=true PANDAS=pandas DELETE_FONT_CACHE=1 TEST_ARGS=
70+
- python: "3.6-dev"
71+
env: PRE=--pre
7072
- python: "nightly"
7173
env: PRE=--pre
7274
- os: osx

lib/matplotlib/axes/_axes.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3841,8 +3841,9 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
38413841
verts=None, edgecolors=None,
38423842
**kwargs):
38433843
"""
3844-
Make a scatter plot of x vs y, where x and y are sequence like objects
3845-
of the same length.
3844+
Make a scatter plot of `x` vs `y`
3845+
3846+
Marker size is scaled by `s` and marker color is mapped to `c`
38463847
38473848
Parameters
38483849
----------
@@ -3890,6 +3891,12 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
38903891
linewidths : scalar or array_like, optional, default: None
38913892
If None, defaults to (lines.linewidth,).
38923893
3894+
verts : sequence of (x, y), optional
3895+
If `marker` is None, these vertices will be used to
3896+
construct the marker. The center of the marker is located
3897+
at (0,0) in normalized units. The overall marker is rescaled
3898+
by ``s``.
3899+
38933900
edgecolors : color or sequence of color, optional, default: None
38943901
If None, defaults to 'face'
38953902

lib/matplotlib/compat/subprocess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from __future__ import print_function
1818
import os
1919
import sys
20-
if os.name == 'posix' and sys.version_info[:2] < (3, 2):
20+
if os.name == 'posix' and sys.version_info[0] < 3:
2121
# work around for https://github.com/matplotlib/matplotlib/issues/5314
2222
try:
2323
import subprocess32 as subprocess

lib/matplotlib/tests/test_lines.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
import matplotlib.pyplot as plt
1818
from matplotlib.testing.decorators import cleanup, image_comparison
1919

20-
import sys
21-
2220

2321
@cleanup
2422
def test_invisible_Line_rendering():
@@ -112,10 +110,6 @@ def test_linestyle_variants():
112110

113111
@cleanup
114112
def test_valid_linestyles():
115-
if sys.version_info[:2] < (2, 7):
116-
raise nose.SkipTest("assert_raises as context manager "
117-
"not supported with Python < 2.7")
118-
119113
line = mlines.Line2D([], [])
120114
with assert_raises(ValueError):
121115
line.set_linestyle('aardvark')
@@ -137,10 +131,6 @@ def test_drawstyle_variants():
137131

138132
@cleanup
139133
def test_valid_drawstyles():
140-
if sys.version_info[:2] < (2, 7):
141-
raise nose.SkipTest("assert_raises as context manager "
142-
"not supported with Python < 2.7")
143-
144134
line = mlines.Line2D([], [])
145135
with assert_raises(ValueError):
146136
line.set_drawstyle('foobar')

lib/matplotlib/tests/test_rcparams.py

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
import io
77
import os
8-
import sys
98
import warnings
9+
from collections import OrderedDict
1010

1111
from cycler import cycler, Cycler
1212

@@ -16,7 +16,6 @@
1616
from matplotlib.testing.decorators import cleanup, knownfailureif
1717
import matplotlib.colors as mcolors
1818
from nose.tools import assert_true, assert_raises, assert_equal
19-
from nose.plugins.skip import SkipTest
2019
import nose
2120
from itertools import chain
2221
import numpy as np
@@ -115,9 +114,6 @@ def test_RcParams_class():
115114

116115

117116
def test_rcparams_update():
118-
if sys.version_info[:2] < (2, 7):
119-
raise nose.SkipTest("assert_raises as context manager "
120-
"not supported with Python < 2.7")
121117
rc = mpl.RcParams({'figure.figsize': (3.5, 42)})
122118
bad_dict = {'figure.figsize': (3.5, 42, 1)}
123119
# make sure validation happens on input
@@ -131,9 +127,6 @@ def test_rcparams_update():
131127

132128

133129
def test_rcparams_init():
134-
if sys.version_info[:2] < (2, 7):
135-
raise nose.SkipTest("assert_raises as context manager "
136-
"not supported with Python < 2.7")
137130
with assert_raises(ValueError):
138131
with warnings.catch_warnings():
139132
warnings.filterwarnings('ignore',
@@ -172,14 +165,6 @@ def test_Bug_2543():
172165
mpl.rcParams['svg.embed_char_paths'] = False
173166
assert_true(mpl.rcParams['svg.fonttype'] == "none")
174167

175-
176-
@cleanup
177-
def test_Bug_2543_newer_python():
178-
# only split from above because of the usage of assert_raises
179-
# as a context manager, which only works in 2.7 and above
180-
if sys.version_info[:2] < (2, 7):
181-
raise nose.SkipTest("assert_raises as context manager not supported with Python < 2.7")
182-
from matplotlib.rcsetup import validate_bool_maybe_none, validate_bool
183168
with assert_raises(ValueError):
184169
validate_bool_maybe_none("blah")
185170
with assert_raises(ValueError):
@@ -249,9 +234,6 @@ def _validation_test_helper(validator, arg, target):
249234

250235

251236
def _validation_fail_helper(validator, arg, exception_type):
252-
if sys.version_info[:2] < (2, 7):
253-
raise nose.SkipTest("assert_raises as context manager not "
254-
"supported with Python < 2.7")
255237
with assert_raises(exception_type):
256238
validator(arg)
257239

@@ -395,11 +377,6 @@ def test_rcparams_reset_after_fail():
395377
# raised an exception due to issues in the supplied rc parameters, the
396378
# global rc parameters were left in a modified state.
397379

398-
if sys.version_info[:2] >= (2, 7):
399-
from collections import OrderedDict
400-
else:
401-
raise SkipTest("Test can only be run in Python >= 2.7 as it requires OrderedDict")
402-
403380
with mpl.rc_context(rc={'text.usetex': False}):
404381

405382
assert mpl.rcParams['text.usetex'] is False

lib/matplotlib/tests/test_style.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
unicode_literals)
33

44
import os
5-
import sys
65
import shutil
76
import tempfile
7+
from collections import OrderedDict
88
from contextlib import contextmanager
99

10-
from nose import SkipTest
1110
from nose.tools import assert_raises
1211
from nose.plugins.attrib import attr
1312

@@ -121,12 +120,6 @@ def test_context_with_union_of_dict_and_namedstyle():
121120

122121

123122
def test_context_with_badparam():
124-
if sys.version_info[:2] >= (2, 7):
125-
from collections import OrderedDict
126-
else:
127-
m = "Test can only be run in Python >= 2.7 as it requires OrderedDict"
128-
raise SkipTest(m)
129-
130123
original_value = 'gray'
131124
other_value = 'blue'
132125
d = OrderedDict([(PARAM, original_value), ('badparam', None)])

lib/matplotlib/tests/test_text.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import numpy as np
88
from numpy.testing import assert_almost_equal
99
from nose.tools import eq_, assert_raises
10-
from nose.plugins.skip import SkipTest
1110

1211
from matplotlib.transforms import Bbox
1312
import matplotlib
@@ -287,10 +286,6 @@ def test_get_rotation_int():
287286

288287
def test_get_rotation_raises():
289288
from matplotlib import text
290-
import sys
291-
if sys.version_info[:2] < (2, 7):
292-
raise SkipTest("assert_raises as context manager "
293-
"not supported with Python < 2.7")
294289
with assert_raises(ValueError):
295290
text.get_rotation('hozirontal')
296291

lib/mpl_toolkits/tests/test_mplot3d.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import sys
2-
import nose
31
from nose.tools import assert_raises
42
from mpl_toolkits.mplot3d import Axes3D, axes3d
53
from matplotlib import cm
@@ -218,9 +216,6 @@ def test_wireframe3dzerorstride():
218216

219217
@cleanup
220218
def test_wireframe3dzerostrideraises():
221-
if sys.version_info[:2] < (2, 7):
222-
raise nose.SkipTest("assert_raises as context manager "
223-
"not supported with Python < 2.7")
224219
fig = plt.figure()
225220
ax = fig.add_subplot(111, projection='3d')
226221
X, Y, Z = axes3d.get_test_data(0.05)

setupext.py

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919

2020
PY3min = (sys.version_info[0] >= 3)
21-
PY32min = (PY3min and sys.version_info[1] >= 2 or sys.version_info[0] > 3)
2221

2322

2423
def _get_home():
@@ -92,7 +91,7 @@ def _get_xdg_cache_dir():
9291

9392
setup_cfg = os.environ.get('MPLSETUPCFG', 'setup.cfg')
9493
if os.path.exists(setup_cfg):
95-
if PY32min:
94+
if PY3min:
9695
config = configparser.ConfigParser()
9796
else:
9897
config = configparser.SafeConfigParser()
@@ -799,7 +798,7 @@ def check(self):
799798
except ImportError:
800799
msgs += [bad_nose]
801800

802-
if sys.version_info >= (3, 3):
801+
if PY3min:
803802
msgs += ['using unittest.mock']
804803
else:
805804
try:
@@ -924,7 +923,7 @@ class Numpy(SetupPackage):
924923

925924
@staticmethod
926925
def include_dirs_hook():
927-
if sys.version_info[0] >= 3:
926+
if PY3min:
928927
import builtins
929928
if hasattr(builtins, '__NUMPY_SETUP__'):
930929
del builtins.__NUMPY_SETUP__
@@ -1141,11 +1140,11 @@ def do_custom_build(self):
11411140
pass
11421141

11431142
if not os.path.isfile(tarball_path):
1144-
1145-
if sys.version_info[0] == 2:
1146-
from urllib import urlretrieve
1147-
else:
1143+
if PY3min:
11481144
from urllib.request import urlretrieve
1145+
else:
1146+
from urllib import urlretrieve
1147+
11491148
if not os.path.exists('build'):
11501149
os.makedirs('build')
11511150

@@ -1494,14 +1493,6 @@ def check(self):
14941493
try:
14951494
import dateutil
14961495
except ImportError:
1497-
# dateutil 2.1 has a file encoding bug that breaks installation on
1498-
# python 3.3
1499-
# https://github.com/matplotlib/matplotlib/issues/2373
1500-
# hack around the problem by installing the (working) v2.0
1501-
major, minor1, _, _, _ = sys.version_info
1502-
if self.version is None and (major, minor1) == (3, 3):
1503-
self.version = '!=2.1'
1504-
15051496
return (
15061497
"dateutil was not found. It is required for date axis "
15071498
"support. pip/easy_install may attempt to install it "
@@ -1520,7 +1511,7 @@ class FuncTools32(SetupPackage):
15201511
name = "functools32"
15211512

15221513
def check(self):
1523-
if sys.version_info[:2] < (3, 2):
1514+
if not PY3min:
15241515
try:
15251516
import functools32
15261517
except ImportError:
@@ -1533,7 +1524,7 @@ def check(self):
15331524
return "Not required"
15341525

15351526
def get_install_requires(self):
1536-
if sys.version_info[:2] < (3, 2):
1527+
if not PY3min:
15371528
return ['functools32']
15381529
else:
15391530
return []
@@ -1543,7 +1534,7 @@ class Subprocess32(SetupPackage):
15431534
name = "subprocess32"
15441535

15451536
def check(self):
1546-
if sys.version_info[:2] < (3, 2):
1537+
if not PY3min:
15471538
try:
15481539
import subprocess32
15491540
except ImportError:
@@ -1557,7 +1548,7 @@ def check(self):
15571548
return "Not required"
15581549

15591550
def get_install_requires(self):
1560-
if sys.version_info[:2] < (3, 2) and os.name == 'posix':
1551+
if not PY3min and os.name == 'posix':
15611552
return ['subprocess32']
15621553
else:
15631554
return []

0 commit comments

Comments
 (0)