8000 Merge branch 'matplotlib:main' into hasans-matplotlib/main · matplotlib/matplotlib@88f9e69 · GitHub
[go: up one dir, main page]

Skip to content

Commit 88f9e69

Browse files
authored
Merge branch 'matplotlib:main' into hasans-matplotlib/main
2 parents c310fab + 11e37ac commit 88f9e69
  • event_handling
  • images_contours_and_fields
  • lines_bars_and_markers
  • misc
  • mplot3d
  • pie_and_polar_charts
  • pyplots
  • scales
  • shapes_and_collections
  • showcase
  • specialty_plots
  • spines
  • subplots_axes_and_figures
  • text_labels_and_annotations
  • ticks
  • units
  • user_interfaces
  • userdemo
  • widgets
  • lib
  • web_backend
  • mpl-data
  • projections
  • sphinxext
  • style
  • testing
  • tests
  • tri
  • mpl_toolkits
  • requirements/testing
  • tools
  • tutorials
  • Some content is hidden

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

    421 files changed

    +2678
    -2024
    lines changed

    .flake8

    Lines changed: 2 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -1,5 +1,5 @@
    11
    [flake8]
    2-
    max-line-length = 79
    2+
    max-line-length = 88
    33
    select =
    44
    # flake8 default
    55
    C90, E, F, W,
    @@ -36,7 +36,6 @@ exclude =
    3636
    doc/tutorials
    3737
    # External files.
    3838
    tools/gh_api.py
    39-
    tools/github_stats.py
    4039
    .tox
    4140
    .eggs
    4241

    @@ -84,6 +83,7 @@ per-file-ignores =
    8483
    tutorials/introductory/quick_start.py: E703
    8584
    tutorials/introductory/animation_tutorial.py: E501
    8685
    tutorials/text/annotations.py: E402, E501
    86+
    tutorials/text/mathtext.py: E501
    8787
    tutorials/text/text_intro.py: E402
    8888
    tutorials/text/text_props.py: E501
    8989
    tutorials/text/usetex.py: E501

    .git-blame-ignore-revs

    Lines changed: 3 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -9,3 +9,6 @@ c1a33a481b9c2df605bcb9bef9c19fe65c3dac21
    99

    1010
    # chore: fix spelling errors
    1111
    686c9e5a413e31c46bb049407d5eca285bcab76d
    12+
    13+
    # chore: pyupgrade --py39-plus
    14+
    4d306402bb66d6d4c694d8e3e14b91054417070e

    .github/workflows/cibuildwheel.yml

    Lines changed: 4 additions & 4 deletions
    Original file line numberDiff line numberDiff line change
    @@ -62,7 +62,7 @@ jobs:
    6262
    fetch-depth: 0
    6363

    6464
    - name: Build wheels for CPython 3.11
    65-
    uses: pypa/cibuildwheel@v2.11.4
    65+
    uses: pypa/cibuildwheel@v2.12.0
    6666
    env:
    6767
    CIBW_BUILD: "cp311-*"
    6868
    CIBW_SKIP: "*-musllinux*"
    @@ -75,7 +75,7 @@ jobs:
    7575
    CIBW_ARCHS: ${{ matrix.cibw_archs }}
    7676

    7777
    - name: Build wheels for CPython 3.10
    78-
    uses: pypa/cibuildwheel@v2.11.4
    78+
    uses: pypa/cibuildwheel@v2.12.0
    7979
    env:
    8080
    CIBW_BUILD: "cp310-*"
    8181
    CIBW_SKIP: "*-musllinux*"
    @@ -88,7 +88,7 @@ jobs:
    8888
    CIBW_ARCHS: ${{ matrix.cibw_archs }}
    8989

    9090
    - name: Build wheels for CPython 3.9
    91-
    uses: pypa/cibuildwheel@v2.11.4
    91+
    uses: pypa/cibuildwheel@v2.12.0
    9292
    env:
    9393
    CIBW_BUILD: "cp39-*"
    9494
    CIBW_SKIP: "*-musllinux*"
    @@ -101,7 +101,7 @@ jobs:
    101101
    CIBW_ARCHS: ${{ matrix.cibw_archs }}
    102102

    103103
    - name: Build wheels for PyPy
    104-
    uses: pypa/cibuildwheel@v2.11.4
    104+
    uses: pypa/cibuildwheel@v2.12.0
    105105
    env:
    106106
    CIBW_BUILD: "pp39-*"
    107107
    CIBW_SKIP: "*-musllinux*"

    .github/workflows/cygwin.yml

    Lines changed: 3 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -51,6 +51,7 @@ jobs:
    5151
    name: Python 3.${{ matrix.python-minor-version }} on Cygwin
    5252
    if: |
    5353
    github.event_name == 'workflow_dispatch' ||
    54+
    github.event_name == 'schedule' ||
    5455
    (
    5556
    github.repository == 'matplotlib/matplotlib' &&
    5657
    !contains(github.event.head_commit.message, '[ci skip]') &&
    @@ -70,7 +71,7 @@ jobs:
    7071
    )
    7172
    strategy:
    7273
    matrix:
    73-
    python-minor-version: [8, 9]
    74+
    python-minor-version: [9]
    7475

    7576
    steps:
    7677
    - name: Fix line endings
    @@ -80,7 +81,7 @@ jobs:
    8081
    with:
    8182
    fetch-depth: 0
    8283

    83-
    - uses: cygwin/cygwin-install-action@v2
    84+
    - uses: cygwin/cygwin-install-action@v3
    8485
    with:
    8586
    packages: >-
    8687
    ccache gcc-g++ gdb git graphviz libcairo-devel libffi-devel

    .github/workflows/nightlies.yml

    Lines changed: 27 additions & 20 deletions
    Original file line numberDiff line numberDiff line change
    @@ -1,3 +1,4 @@
    1+
    ---
    12
    name: Upload nightly wheels to Anaconda Cloud
    23

    34
    on:
    @@ -16,11 +17,14 @@ jobs:
    1617
    runs-on: ubuntu-latest
    1718
    defaults:
    1819
    run:
    19-
    shell: bash -l {0}
    20+
    # The login shell is necessary for the provision-with-micromamba setup
    21+
    # to work in subsequent jobs.
    22+
    # https://github.com/mamba-org/provision-with-micromamba#important
    23+
    shell: bash -e -l {0}
    2024
    if: github.repository_owner == 'matplotlib'
    2125

    2226
    steps:
    23-
    # c.f. https://github.com/actions/download-artifact/issues/3#issuecomment-1017141067
    27+
    # https://github.com/actions/download-artifact/issues/3#issuecomment-1017141067
    2428
    - name: Download wheel artifacts from last build on 'main'
    2529
    env:
    2630
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    @@ -33,16 +37,20 @@ jobs:
    3337
    gh run --repo "${PROJECT_REPO}" \
    3438
    list --branch "${BRANCH}" \
    3539
    --workflow "${WORKFLOW_NAME}" \
    36-
    --json event,status,databaseId > runs.json
    37-
    # Filter on 'push' events to main (merged PRs) that have completed
    38-
    jq --compact-output \
    39-
    '[ .[] | select(.event == "push") | select(.status == "completed") ]' \
    40-
    runs.json > pushes.json
    41-
    # Get id of latest build of wheels
    40+
    --json event,status,conclusion,databaseId > runs.json
    4241
    RUN_ID=$(
    4342
    jq --compact-output \
    44-
    'sort_by(.databaseId) | reverse | .[0].databaseId' pushes.json
    43+
    '[
    44+
    .[] |
    45+
    # Filter on "push" events to main (merged PRs) ...
    46+
    select(.event == "push") |
    47+
    # that have completed successfully ...
    48+
    select(.status == "completed" and .conclusion == "success")
    49+
    ] |
    50+
    # and get ID of latest build of wheels.
    51+
    sort_by(.databaseId) | reverse | .[0].databaseId' runs.json
    4552
    )
    53+
    gh run --repo "${PROJECT_REPO}" view "${RUN_ID}"
    4654
    gh run --repo "${PROJECT_REPO}" \
    4755
    download "${RUN_ID}" --name "${ARTIFACT_NAME}"
    4856
    @@ -52,7 +60,7 @@ jobs:
    5260
    5361
    # N.B. anaconda-client is only maintained on the main channel
    5462
    - name: Install anaconda-client
    55-
    uses: mamba-org/provision-with-micromamba@v14
    63+
    uses: mamba-org/provision-with-micromamba@v15
    5664
    with:
    5765
    environment-file: false
    5866
    environment-name: nightlies
    @@ -71,17 +79,16 @@ jobs:
    7179
    N_LATEST_UPLOADS=5
    7280
    7381
    # Remove all _but_ the last "${N_LATEST_UPLOADS}" package versions
    74-
    # N.B.: `anaconda show` places the newest packages at the bottom of the output
    75-
    # of the 'Versions' section and package versions are preceded with a ' + '.
    82+
    # N.B.: `anaconda show` places the newest packages at the bottom of
    83+
    # the output of the 'Versions' section and package versions are
    84+
    # preceded with a ' + '.
    7685
    anaconda show scipy-wheels-nightly/matplotlib &> >(grep '+') | \
    7786
    sed 's/.* + //' | \
    7887
    head --lines "-${N_LATEST_UPLOADS}" > remove-package-versions.txt
    7988
    80-
    if [ -s remove-package-versions.txt ]; then
    81-
    while LANG=C IFS= read -r package_version ; do
    82-
    echo "# Removing scipy-wheels-nightly/matplotlib/${package_version}"
    83-
    anaconda --token ${{ secrets.ANACONDA_ORG_UPLOAD_TOKEN }} remove \
    84-
    --force \
    85-
    "scipy-wheels-nightly/matplotlib/${package_version}"
    86-
    done <remove-package-versions.txt
    87-
    fi
    89+
    while LANG=C IFS= read -r package_version ; do
    90+
    echo "Removing scipy-wheels-nightly/matplotlib/${package_version}"
    91+
    anaconda --token ${{ secrets.ANACONDA_ORG_UPLOAD_TOKEN }} remove \
    92+
    --force \
    93+
    "scipy-wheels-nightly/matplotlib/${package_version}"
    94+
    done <remove-package-versions.txt

    azure-pipelines.yml

    Lines changed: 1 addition & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -130,8 +130,7 @@ stages:
    130130
    displayName: 'Install dependencies with pip'
    131131
    132132
    - bash: |
    133-
    # Due to https://github.com/pypa/setuptools/pull/2896
    134-
    SETUPTOOLS_USE_DISTUTILS=stdlib python -m pip install -ve . ||
    133+
    python -m pip install -ve . ||
    135134
    [[ "$PYTHON_VERSION" = 'Pre' ]]
    136135
    displayName: "Install self"
    137136
    Lines changed: 12 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -0,0 +1,12 @@
    1+
    TwoSlopeNorm now auto-expands to always have two slopes
    2+
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    3+
    In the case where either ``vmin`` or ``vmax`` are not manually specified
    4+
    to `~.TwoSlopeNorm`, and where the data it is scaling is all less than or
    5+
    greater than the center point, the limits are now auto-expanded so there
    6+
    are two symmetrically sized slopes either side of the center point.
    7+
    8+
    Previously ``vmin`` and ``vmax`` were clipped at the center point, which
    9+
    caused issues when displaying color bars.
    10+
    11+
    This does not affect behaviour when ``vmin`` and ``vmax`` are manually
    12+
    specified by the user.
    Lines changed: 5 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -0,0 +1,5 @@
    1+
    Arguments other than ``renderer`` to ``get_tightbbox``
    2+
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    3+
    4+
    ... are keyword-only arguments. This is for consistency and that
    5+
    different classes have different additional arguments.
    Lines changed: 8 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -0,0 +1,8 @@
    1+
    Maximum line length increased to 88 characters
    2+
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    3+
    4+
    The maximum line length for new contributions has been extended from 79 characters to
    5+
    88 characters.
    6+
    This change provides an extra 9 characters to allow code which is a single idea to fit
    7+
    on fewer lines (often a single line).
    8+
    The chosen length is the same as `black <https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#line-length>`_.

    doc/api/next_api_changes/development/24919-KS.rst

    Lines changed: 2 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -11,6 +11,8 @@ being bumped:
    1111
    +------------+-----------------+---------------+
    1212
    | kiwisolver | 1.0.1 | 1.3.1 |
    1313
    +------------+-----------------+---------------+
    14+
    | NumPy | 1.20.0 | 1.21.0 |
    15+
    +------------+-----------------+---------------+
    1416
    | Pillow | 6.2.1 | 8.0 |
    1517
    +------------+-----------------+---------------+
    1618

    doc/conf.py

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -141,7 +141,7 @@ def _check_dependencies():
    141141
    if missing:
    142142
    raise ImportError(
    143143
    "The following dependencies are missing to build the "
    144-
    "documentation: {}".format(", ".join(missing)))
    144+
    f"documentation: {', '.join(missing)}")
    145145
    if shutil.which('dot') is None:
    146146
    raise OSError(
    147147
    "No binary named dot - graphviz must be installed to build the "

    doc/devel/MEP/MEP08.rst

    Lines changed: 4 additions & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -9,7 +9,10 @@
    99
    Status
    1010
    ======
    1111

    12-
    **Completed**
    12+
    **Superseded**
    13+
    14+
    Current guidelines for style, including usage of pep8 are maintained
    15+
    in `our pull request guidelines <https://matplotlib.org/devdocs/devel/coding_guide.html>`_.
    1316

    1417
    We are currently enforcing a sub-set of pep8 on new code contributions.
    1518

    doc/devel/coding_guide.rst

    Lines changed: 7 additions & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -30,7 +30,8 @@ rules before submitting a pull request:
    3030
    for more details.
    3131

    3232
    * Formatting should follow the recommendations of PEP8_, as enforced by
    33-
    flake8_. You can check flake8 compliance from the command line with ::
    33+
    flake8_. Matplotlib modifies PEP8 to extend the maximum line length to 88
    34+
    characters. You can check flake8 compliance from the command line with ::
    3435

    3536
    python -m pip install flake8
    3637
    flake8 /path/to/module.py
    @@ -156,6 +157,11 @@ Content topics:
    156157
    * Does the PR conform with the :ref:`coding_guidelines`?
    157158
    * Is the :ref:`documentation <pr-documentation>` (docstrings, examples,
    158159
    what's new, API changes) updated?
    160+
    * Is the change purely stylistic? Generally, such changes are discouraged when
    161+
    not part of other non-stylistic work because it obscures the git history of
    162+
    functional changes to the code. Reflowing a method or docstring as part of a
    163+
    larger refactor/rewrite is acceptable.
    164+
    159165

    160166
    Organizational topics:
    161167

    doc/devel/dependencies.rst

    Lines changed: 2 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -21,7 +21,7 @@ reference.
    2121
    * `dateutil <https://pypi.org/project/python-dateutil/>`_ (>= 2.7)
    2222
    * `fontTools <https://fonttools.readthedocs.io/en/latest/>`_ (>= 4.22.0)
    2323
    * `kiwisolver <https://github.com/nucleic/kiwi>`_ (>= 1.3.1)
    24-
    * `NumPy <https://numpy.org>`_ (>= 1.20)
    24+
    * `NumPy <https://numpy.org>`_ (>= 1.21)
    2525
    * `packaging <https://pypi.org/project/packaging/>`_ (>= 20.0)
    2626
    * `Pillow <https://pillow.readthedocs.io/en/latest/>`_ (>= 8.0)
    2727
    * `pyparsing <https://pypi.org/project/pyparsing/>`_ (>= 2.3.1)
    @@ -202,7 +202,7 @@ Setup dependencies
    202202
    - `setuptools_scm <https://pypi.org/project/setuptools-scm/>`_ (>= 7). Used to
    203203
    update the reported ``mpl.__version__`` based on the current git commit.
    204204
    Also a runtime dependency for editable installs.
    205-
    - `NumPy <https://numpy.org>`_ (>= 1.20). Also a runtime dependency.
    205+
    - `NumPy <https://numpy.org>`_ (>= 1.21). Also a runtime dependency.
    206206

    207207

    208208
    .. _compile-dependencies:

    doc/devel/documenting_mpl.rst

    Lines changed: 10 additions & 4 deletions
    Original file line numberDiff line numberDiff line change
    @@ -812,9 +812,15 @@ to create a gallery of images in the :file:`/doc/gallery` and
    812812
    :file:`/doc/tutorials` directories respectively. To exclude an example
    813813
    from having an plot generated insert "sgskip" somewhere in the filename.
    814814

    815+
    816+
    Formatting the example
    817+
    ----------------------
    818+
    815819
    The format of these files is relatively straightforward. Properly
    816820
    formatted comment blocks are treated as ReST_ text, the code is
    817-
    displayed, and figures are put into the built page.
    821+
    displayed, and figures are put into the built page. Matplotlib uses the
    822+
    ``# %%`` section separator so that IDEs will identify "code cells" to make
    823+
    it easy to re-run sub-sections of the example.
    818824

    819825
    For instance the example :doc:`/gallery/lines_bars_and_markers/simple_plot`
    820826
    example is generated from
    @@ -853,7 +859,7 @@ Tutorials are made with the exact same mechanism, except they are longer, and
    853859
    typically have more than one comment block (i.e.
    854860
    :doc:`/tutorials/introductory/quick_start`). The first comment block
    855861
    can be the same as the example above. Subsequent blocks of ReST text
    856-
    are delimited by a line of ``###`` characters:
    862+
    are delimited by the line ``# %%`` :
    857863

    858864
    .. code-block:: python
    859865
    @@ -868,7 +874,7 @@ are delimited by a line of ``###`` characters:
    868874
    ax.grid()
    869875
    plt.show()
    870876
    871-
    ##########################################################################
    877+
    # %%
    872878
    # Second plot
    873879
    # ===========
    874880
    #
    @@ -887,7 +893,7 @@ bottom as follows
    887893

    888894
    .. code-block:: python
    889895
    890-
    ###############################################################################
    896+
    # %%
    891897
    #
    892898
    # .. admonition:: References
    893899
    #

    doc/devel/min_dep_policy.rst

    Lines changed: 2 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -87,6 +87,7 @@ specification of the dependencies.
    8787
    ========== ======== ======
    8888
    Matplotlib Python NumPy
    8989
    ========== ======== ======
    90+
    `3.8`_ 3.9 1.21.0
    9091
    `3.7`_ 3.8 1.20.0
    9192
    `3.6`_ 3.8 1.19.0
    9293
    `3.5`_ 3.7 1.17.0
    @@ -106,6 +107,7 @@ Matplotlib Python NumPy
    106107
    1.0 2.4 1.1
    107108
    ========== ======== ======
    108109

    110+
    .. _`3.8`: https://matplotlib.org/3.8.0/devel/dependencies.html
    109111
    .. _`3.7`: https://matplotlib.org/3.7.0/devel/dependencies.html
    110112
    .. _`3.6`: https://matplotlib.org/3.6.0/devel/dependencies.html
    111113
    .. _`3.5`: https://matplotlib.org/3.5.0/devel/dependencies.html

    0 commit comments

    Comments
     (0)
    0