Skip to content

Commit

Permalink
Merge v1.4.x into master
Browse files Browse the repository at this point in the history
Conflicts:
	src/_path.cpp

src/_path.cpp has been deleted on master, need to apply
the changes to fix matplotlib#3759 to src/_path.h
  • Loading branch information
tacaswell committed Nov 11, 2014
2 parents e2061f7 + c31ffe8 commit d7cc9eb
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -2736,7 +2736,7 @@
2007-02-12 Moved data files into lib/matplotlib so that setuptools'
develop mode works. Re-organized the mpl-data layout so
that this source structure is maintained in the
installation. (I.e. the 'fonts' and 'images'
installation. (i.e., the 'fonts' and 'images'
sub-directories are maintained in site-packages.) Suggest
removing site-packages/matplotlib/mpl-data and
~/.matplotlib/ttffont.cache before installing - ADS
Expand Down
2 changes: 1 addition & 1 deletion doc/api/api_changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1339,7 +1339,7 @@ Changes for 0.90.1

Moved data files into lib/matplotlib so that setuptools' develop
mode works. Re-organized the mpl-data layout so that this source
structure is maintained in the installation. (I.e. the 'fonts' and
structure is maintained in the installation. (i.e., the 'fonts' and
'images' sub-directories are maintained in site-packages.).
Suggest removing site-packages/matplotlib/mpl-data and
~/.matplotlib/ttffont.cache before installing
Expand Down
2 changes: 1 addition & 1 deletion doc/devel/coding_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ illustration) just passes them on to the
self.update(kwargs)

``update`` does the work looking for methods named like
``set_property`` if ``property`` is a keyword argument. I.e., no one
``set_property`` if ``property`` is a keyword argument. i.e., no one
looks at the keywords, they just get passed through the API to the
artist constructor which looks for suitably named methods and calls
them with the value.
Expand Down
2 changes: 1 addition & 1 deletion doc/devel/license.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ most widely used license is the GPL, which in addition to granting you
full rights to the source code including redistribution, carries with
it an extra obligation. If you use GPL code in your own code, or link
with it, your product must be released under a GPL compatible
license. I.e., you are required to give the source code to other
license. i.e., you are required to give the source code to other
people and give them the right to redistribute it as well. Many of the
most famous and widely used open source projects are released under
the GPL, including linux, gcc, emacs and sage.
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/mlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -1423,7 +1423,7 @@ def cohere_pairs(X, ij, NFFT=256, Fs=2, detrend=detrend_none,
where:
- *Cxy*: dictionary of (*i*, *j*) tuples -> coherence vector for
that pair. I.e., ``Cxy[(i,j) = cohere(X[:,i], X[:,j])``.
that pair. i.e., ``Cxy[(i,j) = cohere(X[:,i], X[:,j])``.
Number of dictionary keys is ``len(ij)``.
- *Phase*: dictionary of phases of the cross spectral density at
Expand Down
9 changes: 9 additions & 0 deletions lib/matplotlib/tests/test_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ def test_path_clipping():
xy, facecolor='none', edgecolor='red', closed=True))


def test_point_in_path_nan():
box = np.array([[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]])
p = Path(box)
test = np.array([[np.nan, 0.5]])
contains = p.contains_points(test)
assert len(contains) == 1
assert not contains[0]


if __name__ == '__main__':
import nose
nose.runmodule(argv=['-s', '--with-doctest'], exit=False)
2 changes: 1 addition & 1 deletion lib/matplotlib/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,7 @@ class TextWithDash(Text):
*dashrotation* specifies the rotation of the dash, and should
generally stay *None*. In this case
:meth:`~matplotlib.text.TextWithDash.get_dashrotation` returns
:meth:`~matplotlib.text.Text.get_rotation`. (I.e., the dash takes
:meth:`~matplotlib.text.Text.get_rotation`. (i.e., the dash takes
its rotation from the text's rotation). Because the text center is
projected onto the dash, major deviations in the rotation cause
what may be considered visually unappealing results.
Expand Down
16 changes: 13 additions & 3 deletions src/_path.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,12 @@ void point_in_path_impl(PointArray &points, PathIterator &path, ResultArray &ins
for (i = 0; i < n; ++i) {
ty = points[i][1];

// get test bit for above/below X axis
yflag0[i] = (vty0 >= ty);
if (MPL_isfinite64(ty)) {
// get test bit for above/below X axis
yflag0[i] = (vty0 >= ty);

subpath_flag[i] = 0;
subpath_flag[i] = 0;
}
}

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

if (MPL_notisfinite64(tx) || MPL_notisfinite64(ty)) {
continue;
}

yflag1 = (vty1 >= ty);
// Check if endpoints straddle (are on opposite sides) of
// X axis (i.e. the Y's differ); if so, +X ray could
Expand Down Expand Up @@ -168,6 +174,10 @@ void point_in_path_impl(PointArray &points, PathIterator &path, ResultArray &ins
tx = points[i][0];
ty = points[i][1];

if (MPL_notisfinite64(tx) || MPL_notisfinite64(ty)) {
continue;
}

yflag1 = (vty1 >= ty);
if (yflag0[i] != yflag1) {
if (((vty1 - ty) * (vtx0 - vtx1) >= (vtx1 - tx) * (vty0 - vty1)) == yflag1) {
Expand Down

0 comments on commit d7cc9eb

Please sign in to comment.