Skip to content

Commit d7cc9eb

Browse files
committed
Merge v1.4.x into master
Conflicts: src/_path.cpp src/_path.cpp has been deleted on master, need to apply the changes to fix #3759 to src/_path.h
2 parents e2061f7 + c31ffe8 commit d7cc9eb

File tree

8 files changed

+28
-9
lines changed

8 files changed

+28
-9
lines changed

CHANGELOG

+1-1
Original file line numberDiff line numberDiff line change
@@ -2736,7 +2736,7 @@
27362736
2007-02-12 Moved data files into lib/matplotlib so that setuptools'
27372737
develop mode works. Re-organized the mpl-data layout so
27382738
that this source structure is maintained in the
2739-
installation. (I.e. the 'fonts' and 'images'
2739+
installation. (i.e., the 'fonts' and 'images'
27402740
sub-directories are maintained in site-packages.) Suggest
27412741
removing site-packages/matplotlib/mpl-data and
27422742
~/.matplotlib/ttffont.cache before installing - ADS

doc/api/api_changes.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1339,7 +1339,7 @@ Changes for 0.90.1
13391339

13401340
Moved data files into lib/matplotlib so that setuptools' develop
13411341
mode works. Re-organized the mpl-data layout so that this source
1342-
structure is maintained in the installation. (I.e. the 'fonts' and
1342+
structure is maintained in the installation. (i.e., the 'fonts' and
13431343
'images' sub-directories are maintained in site-packages.).
13441344
Suggest removing site-packages/matplotlib/mpl-data and
13451345
~/.matplotlib/ttffont.cache before installing

doc/devel/coding_guide.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ illustration) just passes them on to the
201201
self.update(kwargs)
202202

203203
``update`` does the work looking for methods named like
204-
``set_property`` if ``property`` is a keyword argument. I.e., no one
204+
``set_property`` if ``property`` is a keyword argument. i.e., no one
205205
looks at the keywords, they just get passed through the API to the
206206
artist constructor which looks for suitably named methods and calls
207207
them with the value.

doc/devel/license.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ most widely used license is the GPL, which in addition to granting you
2828
full rights to the source code including redistribution, carries with
2929
it an extra obligation. If you use GPL code in your own code, or link
3030
with it, your product must be released under a GPL compatible
31-
license. I.e., you are required to give the source code to other
31+
license. i.e., you are required to give the source code to other
3232
people and give them the right to redistribute it as well. Many of the
3333
most famous and widely used open source projects are released under
3434
the GPL, including linux, gcc, emacs and sage.

lib/matplotlib/mlab.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1423,7 +1423,7 @@ def cohere_pairs(X, ij, NFFT=256, Fs=2, detrend=detrend_none,
14231423
where:
14241424
14251425
- *Cxy*: dictionary of (*i*, *j*) tuples -> coherence vector for
1426-
that pair. I.e., ``Cxy[(i,j) = cohere(X[:,i], X[:,j])``.
1426+
that pair. i.e., ``Cxy[(i,j) = cohere(X[:,i], X[:,j])``.
14271427
Number of dictionary keys is ``len(ij)``.
14281428
14291429
- *Phase*: dictionary of phases of the cross spectral density at

lib/matplotlib/tests/test_path.py

+9
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,15 @@ def test_path_clipping():
6161
xy, facecolor='none', edgecolor='red', closed=True))
6262

6363

64+
def test_point_in_path_nan():
65+
box = np.array([[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]])
66+
p = Path(box)
67+
test = np.array([[np.nan, 0.5]])
68+
contains = p.contains_points(test)
69+
assert len(contains) == 1
70+
assert not contains[0]
71+
72+
6473
if __name__ == '__main__':
6574
import nose
6675
nose.runmodule(argv=['-s', '--with-doctest'], exit=False)

lib/matplotlib/text.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ class TextWithDash(Text):
10361036
*dashrotation* specifies the rotation of the dash, and should
10371037
generally stay *None*. In this case
10381038
:meth:`~matplotlib.text.TextWithDash.get_dashrotation` returns
1039-
:meth:`~matplotlib.text.Text.get_rotation`. (I.e., the dash takes
1039+
:meth:`~matplotlib.text.Text.get_rotation`. (i.e., the dash takes
10401040
its rotation from the text's rotation). Because the text center is
10411041
projected onto the dash, major deviations in the rotation cause
10421042
what may be considered visually unappealing results.

src/_path.h

+13-3
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,12 @@ void point_in_path_impl(PointArray &points, PathIterator &path, ResultArray &ins
102102
for (i = 0; i < n; ++i) {
103103
ty = points[i][1];
104104

105-
// get test bit for above/below X axis
106-
yflag0[i] = (vty0 >= ty);
105+
if (MPL_isfinite64(ty)) {
106+
// get test bit for above/below X axis
107+
yflag0[i] = (vty0 >= ty);
107108

108-
subpath_flag[i] = 0;
109+
subpath_flag[i] = 0;
110+
}
109111
}
110112

111113
do {
@@ -124,6 +126,10 @@ void point_in_path_impl(PointArray &points, PathIterator &path, ResultArray &ins
124126
tx = points[i][0];
125127
ty = points[i][1];
126128

129+
if (MPL_notisfinite64(tx) || MPL_notisfinite64(ty)) {
130+
continue;
131+
}
132+
127133
yflag1 = (vty1 >= ty);
128134
// Check if endpoints straddle (are on opposite sides) of
129135
// X axis (i.e. the Y's differ); if so, +X ray could
@@ -168,6 +174,10 @@ void point_in_path_impl(PointArray &points, PathIterator &path, ResultArray &ins
168174
tx = points[i][0];
169175
ty = points[i][1];
170176

177+
if (MPL_notisfinite64(tx) || MPL_notisfinite64(ty)) {
178+
continue;
179+
}
180+
171181
yflag1 = (vty1 >= ty);
172182
if (yflag0[i] != yflag1) {
173183
if (((vty1 - ty) * (vtx0 - vtx1) >= (vtx1 - tx) * (vty0 - vty1)) == yflag1) {

0 commit comments

Comments
 (0)