Skip to content

Commit 76e3693

Browse files
author
Isa Hassen
authored
update (#7)
* Update documentation of stem changed here: matplotlib@d68662a * Update vlines example with axes wide lines. * Clean up BoundaryNorm docstring * Document what happens when ncolors > bins * BoundaryNorm docstring clarification * BoundaryNorm docstring formatting * Added set_xlim and set_ylim check for non-finite limit values * FIX: masked images with interpolation When determining which pixels to mask in the resampled image, if _any_ contribution to final value comes from a masked pixel, mask the result. Due to Agg special-casing the meaning of the alpha channel, the interpolation for the mask channel needs to be done separately. This is probably a template for doing the over/under separately. print out exact hash on travis * Cleaned up invalid axis limit warning text * FIX tick label alignment can now be specified This patch adds two new rcParams allowing to set label alignment. The sole reason for the existance of these new parameters is to allow user to reset the style to before 2.0 for testing purposes. More specifically, ytick horizontal alignement was changed in a non backward compatible way. xtick vertical alignement was added for API consistency. closes matplotlib#7905 * MAINT created a new private _classic_test stylesheet This allows the public classic stylesheet to be 'more' backward compatible * FIX small nitpicks * Template-ize visual_tests.py. * Pass missing variable to format string. * Simplify dictionary access in visual_tests.py. * PEP8 visual_tests.py. * Sort results in visual test HTML. This makes the result a bit more reproducable and comparable. * Don't start a browser for visual tests on CI. Travis may or may not have a browser installed, but AppVeyor definitely does, so this saves a tiny bit of processing power per run. * Move visual_tests into tools. * Add tools directory to pep8. * pgf: Fix invalid arguments passed to pdftocairo. This breaks saving PNG when using the PGF backend. Fixes matplotlib#8121. * MAINT Backporting of matplotlib#7995. Set sticky_edges correctly for negative height bar(). * Small docstring fixes * merge fill_demo and fill_demo_features * move imports below title * Merge docstring coherent * Plot errorbars if fmt=='none' * Add test for fmt=='none' * Fix small spelling mistake * Check plotted bars are color C0 * Add cleanup to new test * Simplify multicolored_line example * Move multicolored_line example * Small fixes * Put boundarynorm example back in * Add autoclass entry for Artist API doc. Adding an autoclass entry in the Artist API ensures that that class appears in the intersphinx `build/html/object.inv`, as can be checked by ``` "matplotlib.artist.Artist" in ( sphinx.ext.intersphinx.read_inventory( open("build/html/objects.inv", "rb"), None, lambda *args: None)[ "py:class"]) ``` (now returns True). This allows other projects to link to that class in their docs using ``` `Artist` <matplotlib.artist.Artist> ``` This possibility used to be present, but disappeared when the Artist API doc got refactored. (Other classes that appear in the API docs are fine as they already use autoclass.) * Merge pull request matplotlib#8171 from afvincent/typo_eventplot_docstring DOC: Fix small typos in 'eventplot' docstring * Fix layout of spectrum_demo.py * Beautified spectrum_demo.py a little more. * Added plot titles to spectrum_demo.py * Correct theta values when drawing a non-circular ellipse Make arcs work with units Add api change not for elliptical notes Add background ellipse and extra line to test Remove pdf and svg tests for arc angles * Fix small typo in api change * add gitter link in README * add a line to README that explains use of gitter * Fixes matplotlib#8141 Validators for dashed linestyles now allow None as an allowed value along with floats through optional `allow_none` kwarg in validate_nseq_float. Other validators that use validate_nseq_float arent affected * Replace second instance of gitter badge with a link * TST: Enable cache directories on AppVeyor. * Use secure links to FreeType tarballs. * Try harder to cache FreeType tarball on Python 2. * TST: Always delete extra cache files on Travis. Note, we don't need to do this on AppVeyor because the cache directories are different. * add parameter and test * implemented label rotation * pep8 fix * DOC moved autowarp_demo to sphinx-gallery compatible docstring * DOC spines example are now sphinx-gallery compliant * DOC all tick labels examples are now sphinx-gallery compatible * DOC moved text_demo_fontdict to sphinx-gallery compatible docstring * TST: skip fc-list related tests if not installed * DOC FIX removed a blank line from an example * DOC moving showcase examples to sphinx-gallery * Plural of axis is axes * add early check for dot binary (from graphviz) when building the doc * Clarify segment array shape * Make ginput dostring into a numpydocstring Small fixes Add default value for npoints Suggested changes to ginput docstring Better description of ginput return Put summary line by itself at the top Add in missing full stops * Implement Path.intersects_bbox in C++ to speed up legend positioning. * DOC removed/added blankspace * DOC fixe small typos and blank lines * DOC capitalized firefox * renamed flag to 'rotatelabels'; fix vertical alignment * Update spines_demo.py * MEP12 alignment_test * Move alignment_test example * MEP12 and simplify ganged_plots example * Move ganged plots example * pep8 fix * added headers * added/fixed headers * DOC removed redundant call to plt.show() * DOC added docstring to vline-hline example. * fix gitter badge * Set subplot spacing to zero * Clean up description wording * fix rst markup * Fix pep8 violation * Fix example description phrasing * Remove image with non-free color calibration profile The example that used to use this image was remove already in commit 9692c31. This closes matplotlib#8034. * MAINT Backporting of matplotlib#8241: remove possible non-free image * Ignore invisible axes in computing tight_layout. * combining and updating 2d hist examples * consolidating histogram examples and moving to SG folder * Memoize parse_fontconfig_pattern; speeds up test suite by ~1min. On my laptop this patch drops the duration of the test suite from 604s to 554s (with the inkscape patch on as well). * addressing small change comments * Contouring 1x1 array (issue 8197) * another attempt; add a test * Set __name__ for list validators in rcsetup. This avoids having many validators all named `f`, which makes profiling a bit difficult (it appears that repeated validation of rcparams when resetting the style at the beginning of each test instance contributes quite a bit to the total test time). Instead, the list validator based on scalar validator function `validate_foo` is now `__name__`d `validate_foolist`, and the list validator based on scalar validator class `ValidateFoo` is now `__name__`d `ValidateFooList`. * TST: fail on missing baseline file * re-add conditional check. * DOC moved spines examples sphinx-gallery * Use sys.executable -msphinx instead of sphinx-build. * More robust type checking in '_validate_linestyle', on both Py2 and Py3 * tests now depend on python version to check cases with bytes args * DOC changes in travis's build environment * DOC removed duplicate appveyor py3.5 environment * CI: travis runs documentation build and mac osx only on merge with master * MAINT remove py.test from our travis build * FIX appveyor doesn't need option USE_PYTEST anymore * append test images. * removed obsolete license.py file * DOC moved changelog to the documentation * DOC fix broken links * MAINT moved some maintenance and helper python scripts to tools/ * FIX path in boilerplate.py * Small header comment fixes * Removes OldScalarFormatter * Renaming file to scalarformatter_demo.py * Renaming to plot_scalarformatter.py * Adds title and description * changing name in backend_driver.py * Inkscape shell mode. * Fix minimum sphinx version in doc-requirements.txt. * Correcting typos and moving file to ticks and spines * STY: fix whitespace in the tests * Remove executable bit from examples and headers. The vast majority of examples do not have the executable bit set, so just make everything consistent. Also remove `#!/usr/bin/env python` where appropriate. * DOC shapes and collections is fully SG compatible * Use neutral pronoun in docs.
1 parent 45eadc1 commit 76e3693

160 files changed

Lines changed: 5119 additions & 890 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.travis.yml‎

Lines changed: 10 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -48,26 +48,26 @@ env:
4848
- PYTEST_ARGS="-ra --maxfail=1 --timeout=300 --durations=25 --cov-report= --cov=lib -n $NPROC"
4949
- PYTHON_ARGS=
5050
- DELETE_FONT_CACHE=
51-
- USE_PYTEST=false
5251

5352
matrix:
5453
include:
5554
- python: 2.7
56-
env: MOCK=mock NUMPY=numpy==1.7.1
55+
env: MOCK=mock NUMPY=numpy==1.7.1 PANDAS=pandas
56+
- python: 2.7
57+
env: BUILD_DOCS=true
5758
- python: 3.4
5859
env: PYTHON_ARGS=-OO
5960
- python: 3.5
6061
env: BUILD_DOCS=true
61-
- python: 3.5
62-
env: USE_PYTEST=true PANDAS=pandas DELETE_FONT_CACHE=1
6362
- python: 3.6
64-
env: USE_PYTEST=true DELETE_FONT_CACHE=1 INSTALL_PEP8=pytest-pep8 RUN_PEP8=--pep8
63+
env: DELETE_FONT_CACHE=1 INSTALL_PEP8=pytest-pep8 RUN_PEP8=--pep8
6564
- python: "nightly"
6665
env: PRE=--pre
6766
- os: osx
6867
osx_image: xcode7.3
6968
language: generic # https://github.com/travis-ci/travis-ci/issues/2312
7069
env: MOCK=mock
70+
only: master
7171
cache:
7272
# As for now travis caches only "$HOME/.cache/pip"
7373
# https://docs.travis-ci.com/user/caching/#pip-cache
@@ -102,9 +102,12 @@ before_install:
102102
fi
103103
104104
install:
105+
# Upgrade pip and setuptools. Mock has issues with the default version of
106+
# setuptools
105107
- |
106108
# Setup environment
107109
ccache -s
110+
git describe
108111
# Upgrade pip and setuptools and wheel to get as clean an install as possible
109112
pip install --upgrade pip
110113
pip install --upgrade wheel
@@ -138,46 +141,8 @@ install:
138141
# Install matplotlib
139142
pip install -ve .
140143
141-
script:
142-
# The number of processes is hardcoded, because using too many causes the
143-
# Travis VM to run out of memory (since so many copies of inkscape and
144-
# ghostscript are running at the same time).
145-
- |
146-
echo Testing import of tkagg backend
147-
MPLBACKEND="tkagg" python -c 'import matplotlib.pyplot as plt; print(plt.get_backend())'
148-
if [[ $BUILD_DOCS == false ]]; then
149-
if [[ $DELETE_FONT_CACHE == 1 ]]; then
150-
rm -rf ~/.cache/matplotlib
151-
fi
152-
# Workaround for pytest-xdist flaky collection order
153-
# https://github.com/pytest-dev/pytest/issues/920
154-
# https://github.com/pytest-dev/pytest/issues/1075
155-
export PYTHONHASHSEED=$(python -c 'import random; print(random.randint(1, 4294967295))')
156-
echo PYTHONHASHSEED=$PYTHONHASHSEED
157-
158-
echo The following args are passed to pytest $PYTEST_ARGS $RUN_PEP8
159-
if [[ $USE_PYTEST == false ]]; then
160-
if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
161-
python tests.py $PYTEST_ARGS $RUN_PEP8
162-
else
163-
gdb -return-child-result -batch -ex r -ex bt --args python $PYTHON_ARGS tests.py $PYTEST_ARGS $RUN_PEP8
164-
fi
165-
else
166-
py.test $PYTEST_ARGS $RUN_PEP8
167-
fi
168-
else
169-
cd doc
170-
python make.py html -n 2
171-
# We don't build the LaTeX docs here, so linkchecker will complain
172-
touch build/html/Matplotlib.pdf
173-
# Linkchecker only works with python 2.7 for the time being
174-
deactivate
175-
source ~/virtualenv/python2.7/bin/activate
176-
pip install pip --upgrade
177-
# linkchecker is currently broken with requests 2.10.0 so force an earlier version
178-
pip install $PRE requests==2.9.2 linkchecker
179-
linkchecker build/html/index.html
180-
fi
144+
script: source ci/travis/test_script.sh
145+
before_cache:
181146
- rm -rf $HOME/.cache/matplotlib/tex.cache
182147
- rm -rf $HOME/.cache/matplotlib/test_cache
183148

‎Makefile‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ clean:
2121

2222
release: ${DISTFILES}
2323
rm -f MANIFEST;\
24-
${PYTHON} license.py ${VERSION} license/LICENSE;\
2524
${PYTHON} setup.py sdist --formats=gztar,zip;
2625

2726
pyback:

‎README.rst‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313
.. |PyPi| image:: https://badge.fury.io/py/matplotlib.svg
1414
.. _PyPi: https://badge.fury.io/py/matplotlib
1515

16-
.. |Gitter| image:: https://badges.gitter.im/Join%20Chat.svg
17-
:alt: Join the chat at https://gitter.im/matplotlib/matplotlib
18-
.. _Gitter: https://gitter.im/matplotlib/matplotlib?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
16+
.. |Gitter| image:: https://img.shields.io/gitter/room/nwjs/nw.js.svg
17+
:target: https://gitter.im/matplotlib/matplotlib?utm_source=share-link&utm_medium=link&utm_campaign=share-link
1918

2019
.. |Depsy| image:: http://depsy.org/api/package/pypi/matplotlib/badge.svg
2120
.. _Depsy: http://depsy.org/package/python/matplotlib
@@ -61,11 +60,9 @@ matplotlib's communication channels include active mailing lists:
6160
* `Announcement <https://mail.python.org/mailman/listinfo/matplotlib-announce>`_ mailing list: [email protected]
6261
* `Development <https://mail.python.org/mailman/listinfo/matplotlib-devel>`_ mailing list: [email protected]
6362

64-
6563
The first is a good starting point for general questions and discussions.
6664

67-
68-
65+
`Gitter <https://gitter.im/matplotlib/matplotlib>`_ is for coordinating development and asking questions directly related to contributing to matplotlib.
6966

7067
Contribute
7168
==========

‎appveyor.yml‎

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ environment:
1515
# Workaround for https://github.com/conda/conda-build/issues/636
1616
PYTHONIOENCODING: "UTF-8"
1717
PYTEST_ARGS: -ra --timeout=300 --durations=25 -n %NUMBER_OF_PROCESSORS% --cov-report= --cov=lib -m "not network"
18-
USE_PYTEST: no
1918
PYTHONHASHSEED: 0 # Workaround for pytest-xdist flaky collection order
2019
# https://github.com/pytest-dev/pytest/issues/920
2120
# https://github.com/pytest-dev/pytest/issues/1075
@@ -37,13 +36,6 @@ environment:
3736
PYTHON_VERSION: "3.5"
3837
TEST_ALL: "no"
3938
CONDA_INSTALL_LOCN: "C:\\Miniconda35-x64"
40-
- TARGET_ARCH: "x64"
41-
CONDA_PY: "35"
42-
CONDA_NPY: "110"
43-
PYTHON_VERSION: "3.5"
44-
TEST_ALL: "no"
45-
CONDA_INSTALL_LOCN: "C:\\Miniconda35-x64"
46-
USE_PYTEST: yes
4739
- TARGET_ARCH: "x86"
4840
CONDA_PY: "27"
4941
CONDA_NPY: "18"
@@ -63,8 +55,12 @@ platform:
6355
# all our python builds have to happen in tests_script...
6456
build: false
6557

58+
cache:
59+
- '%LOCALAPPDATA%\pip\Cache'
60+
- '%USERPROFILE%\.cache\matplotlib'
61+
6662
init:
67-
- cmd: "ECHO %PYTHON_VERSION% PYTEST=%USE_PYTEST% %CONDA_INSTALL_LOCN%"
63+
- cmd: "ECHO %PYTHON_VERSION% %CONDA_INSTALL_LOCN%"
6864

6965
install:
7066
- cmd: set PATH=%CONDA_INSTALL_LOCN%;%CONDA_INSTALL_LOCN%\scripts;%PATH%;
@@ -136,10 +132,9 @@ test_script:
136132
- python -c "import matplotlib as m; m.use('tkagg'); import matplotlib.pyplot as plt; print(plt.get_backend())"
137133
# tests
138134
- echo The following args are passed to pytest %PYTEST_ARGS%
139-
- if x%USE_PYTEST% == xyes py.test %PYTEST_ARGS%
140-
- if x%USE_PYTEST% == xno python tests.py %PYTEST_ARGS%
135+
- python tests.py %PYTEST_ARGS%
141136
# Generate a html for visual tests
142-
- python visual_tests.py
137+
- python tools/visualize_tests.py --no-browser
143138
- pip install codecov
144139
- codecov -e PYTHON_VERSION PLATFORM
145140

@@ -180,7 +175,7 @@ artifacts:
180175
on_finish:
181176

182177
on_failure:
183-
- python visual_tests.py
178+
- python tools/visualize_tests.py --no-browser
184179
- echo zipping images after a failure...
185180
- 7z a result_images.zip result_images\ |grep -v "Compressing"
186181
- appveyor PushArtifact result_images.zip

‎ci/travis/test_script.sh‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#! /bin/bash
2+
3+
# This script is meant to be called by the "script" step defined in
4+
# .travis.yml. See http://docs.travis-ci.com/ for more details.
5+
# The behavior of the script is controlled by environment variabled defined
6+
# in the .travis.yml in the top level folder of the project.
7+
8+
# The number of processes is hardcoded, because using too many causes the
9+
# Travis VM to run out of memory (since so many copies of inkscape and
10+
# ghostscript are running at the same time).
11+
12+
echo Testing import of tkagg backend
13+
MPLBACKEND="tkagg" python -c 'import matplotlib.pyplot as plt; print(plt.get_backend())'
14+
15+
if [[ $BUILD_DOCS == false ]]; then
16+
if [[ $DELETE_FONT_CACHE == 1 ]]; then
17+
rm -rf ~/.cache/matplotlib
18+
fi
19+
# Workaround for pytest-xdist flaky collection order
20+
# https://github.com/pytest-dev/pytest/issues/920
21+
# https://github.com/pytest-dev/pytest/issues/1075
22+
export PYTHONHASHSEED=$(python -c 'import random; print(random.randint(1, 4294967295))')
23+
echo PYTHONHASHSEED=$PYTHONHASHSEED
24+
25+
echo The following args are passed to pytest $PYTEST_ARGS $RUN_PEP8
26+
if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
27+
python tests.py $PYTEST_ARGS $RUN_PEP8
28+
else
29+
gdb -return-child-result -batch -ex r -ex bt --args python $PYTHON_ARGS tests.py $PYTEST_ARGS $RUN_PEP8
30+
fi
31+
else
32+
cd doc
33+
python make.py html -n 2
34+
# We don't build the LaTeX docs here, so linkchecker will complain
35+
touch build/html/Matplotlib.pdf
36+
# Linkchecker only works with python 2.7 for the time being
37+
deactivate
38+
source ~/virtualenv/python2.7/bin/activate
39+
pip install pip --upgrade
40+
# linkchecker is currently broken with requests 2.10.0 so force an earlier version
41+
pip install $PRE requests==2.9.2 linkchecker
42+
linkchecker build/html/index.html
43+
fi

‎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.0,!=1.5.0
9+
sphinx>=1.3,!=1.5.0
1010
numpydoc
1111
ipython
1212
mock
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Elliptical arcs now drawn between correct angles
2+
````````````````````````````````````````````````
3+
4+
The `matplotlib.patches.Arc` patch is now correctly drawn between the given
5+
angles.
6+
7+
Previously a circular arc was drawn and then stretched into an ellipse,
8+
so the resulting arc did not lie between *theta1* and *theta2*.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Path.intersects_bbox always treats the bounding box as filled
2+
`````````````````````````````````````````````````````````````
3+
4+
Previously, when ``Path.intersects_bbox`` was called with ``filled`` set to
5+
``False``, it would treat both the path and the bounding box as unfilled. This
6+
behavior was not well documented and it is usually not the desired behavior,
7+
since bounding boxes are used to represent more complex shapes located inside
8+
the bounding box. This behavior has now been changed: when ``filled`` is
9+
``False``, the path will be treated as unfilled, but the bounding box is still
10+
treated as filled. The old behavior was arguably an implementation bug.
11+
12+
When ``Path.intersects_bbox`` is called with ``filled`` set to ``True``
13+
(the default value), there is no change in behavior. For those rare cases where
14+
``Path.intersects_bbox`` was called with ``filled`` set to ``False`` and where
15+
the old behavior is actually desired, the suggested workaround is to call
16+
``Path.intersects_path`` with a rectangle as the path::
17+
18+
from matplotlib.path import Path
19+
from matplotlib.transforms import Bbox, BboxTransformTo
20+
rect = Path.unit_rectangle().transformed(BboxTransformTo(bbox))
21+
result = path.intersects_path(rect, filled=False)

‎doc/api/artist_api.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
``Artist`` class
1717
================
1818

19+
.. autoclass:: Artist
1920

2021
Interactive
2122
-----------

‎doc/conf.py‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import os
1515
import sys
1616
import sphinx
17+
import six
1718

1819
# If your extensions are in another directory, add it here. If the directory
1920
# is relative to the documentation root, use os.path.abspath to make it
@@ -73,6 +74,16 @@
7374
raise ImportError("No module named Image - you need to install "
7475
"pillow to build the documentation")
7576

77+
if six.PY2:
78+
from distutils.spawn import find_executable
79+
has_dot = find_executable('dot') is not None
80+
else:
81+
from shutil import which # Python >= 3.3
82+
has_dot = which('dot') is not None
83+
if not has_dot:
84+
raise OSError(
85+
"No binary named dot - you need to install the Graph Visualization "
86+
"software (usually packaged as 'graphviz') to build the documentation")
7687

7788
try:
7889
import matplotlib

0 commit comments

Comments
 (0)