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

Skip to content

Commit 948fbde

Browse files
committed
Merge branch 'main' into text-overhaul
2 parents d4bace4 + 86f65d7 commit 948fbde

142 files changed

Lines changed: 1479 additions & 918 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.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ Additionally, please summarize the changes in the title, for example "Raise Valu
1414
non-numeric input to set_xlim" and avoid non-descriptive titles such as "Addresses
1515
issue #8576".
1616
17-
If possible, please provide a minimum self-contained example. If you have used
18-
generative AI as an aid in preparing this PR, see
17+
If possible, please provide a minimum self-contained example.
18+
-->
1919

20+
## AI Disclosure
21+
<!-- If you used AI in writing this PR, please briefly describe how.
22+
Read our policy at
2023
https://matplotlib.org/devdocs/devel/contribute.html#restrictions-on-generative-ai-usage
2124
-->
2225

23-
2426
## PR checklist
2527
<!-- Please mark any checkboxes that do not apply to this PR as [N/A].-->
2628

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
persist-credentials: false
3333

3434
- name: Initialize CodeQL
35-
uses: github/codeql-action/init@9e907b5e64f6b83e7804b09294d44122997950d6 # v4.32.3
35+
uses: github/codeql-action/init@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
3636
with:
3737
languages: ${{ matrix.language }}
3838

@@ -43,4 +43,4 @@ jobs:
4343
pip install --user -v .
4444
4545
- name: Perform CodeQL Analysis
46-
uses: github/codeql-action/analyze@9e907b5e64f6b83e7804b09294d44122997950d6 # v4.32.3
46+
uses: github/codeql-action/analyze@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4

.github/workflows/good-first-issue.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
### Good first issue - notes for new contributors
2020
2121
This issue is suited to new contributors because it does not require
22-
understanding of the Matplotlib internals. This is a low priority task
22+
understanding of the Matplotlib internals. This is a non-urgent task
2323
intended for human contributors to learn how to contribute; therefore please
2424
do not try to automate a solution using AI. To get started, please see our
2525
[contributing guide](https://matplotlib.org/stable/devel/index).

.github/workflows/stale-tidy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
if: github.repository == 'matplotlib/matplotlib'
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/stale@997185467fa4f803885201cee163a9f38240193d # v10.1.1
12+
- uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10.2.0
1313
with:
1414
repo-token: ${{ secrets.GITHUB_TOKEN }}
1515
operations-per-run: 300

.github/workflows/stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
if: github.repository == 'matplotlib/matplotlib'
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/stale@997185467fa4f803885201cee163a9f38240193d # v10.1.1
12+
- uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10.2.0
1313
with:
1414
repo-token: ${{ secrets.GITHUB_TOKEN }}
1515
operations-per-run: 20
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Rendering of images now more accurate
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
There have been several fixes to improve the accuracy of how images are
4+
resampled and placed during rendering. Some inaccuracies were up to a pixel off
5+
in the output. The most apparent improvement is that the alignment of data
6+
pixels with tick marks and grid lines is now reliable. Nearly all image output
7+
has changed, but often only at a subtle level that is not obvious qualitatively.

doc/devel/api_changes.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,20 @@ take particular care when adding new API:
3232
__ https://emptysqua.re/blog/api-evolution-the-right-way/#adding-parameters
3333

3434

35+
Add new rcParams
36+
^^^^^^^^^^^^^^^^
37+
38+
When adding a new rcParam, the following files must be updated:
39+
40+
1. :file:`lib/matplotlib/rcsetup.py` - Add a validator entry to the
41+
``_validators`` dict and a corresponding ``_Param`` entry with default value
42+
and description.
43+
2. :file:`lib/matplotlib/mpl-data/matplotlibrc` - Add a commented-out entry
44+
showing the default value.
45+
3. :file:`lib/matplotlib/typing.py` - Add the key to the ``RcKeyType`` Literal
46+
so that it is recognized as a valid rcParam key.
47+
48+
3549
Add or change colormaps, color sequences, and styles
3650
----------------------------------------------------
3751
Visual changes are considered an API break. Therefore, we generally do not modify

doc/devel/contribute.rst

Lines changed: 45 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@ Ways to contribute
2121
:open:
2222
:icon: person-fill
2323

24-
100% yes! There are so many ways to contribute to our community. Take a look
25-
at the following sections to learn more.
26-
27-
There are a few typical new contributor profiles:
24+
Here are a few typical new contributor profiles. If you
25+
don't fit into one of them, come talk to us on `Discourse
26+
<https://discourse.matplotlib.org/>`_ about how you might contribute.
2827

2928
* **You are a Matplotlib user, and you see a bug, a potential improvement, or
3029
something that annoys you, and you can fix it.**
@@ -60,12 +59,14 @@ Ways to contribute
6059
chance it is a unique context in any given conversation) and make it easier to
6160
understand where other people are coming from.
6261

63-
Understanding the entire codebase is a long-term project, and nobody expects
64-
you to do this right away. If you are determined to get started with
65-
Matplotlib and want to learn, going through the basic functionality,
66-
choosing something to focus on (3d, testing, documentation, animations, etc.)
67-
and gaining context on this area by reading the issues and pull requests
68-
touching these subjects is a reasonable approach.
62+
Understanding the entire codebase is a long-term project, and nobody
63+
expects you to do this right away. Start by building your experience in
64+
using Matplotlib: make complicated visualizations, use niche features,
65+
dive deep into one part of the library. This will help you build the
66+
context to then look at the existing issues and pull requests. You can
67+
then reach out to us at the :ref:`new contributor <new_contributors>`
68+
meeting or Discourse channel (incubator) to discuss what you would like
69+
to work on.
6970

7071
.. _contribute_code:
7172

@@ -196,6 +197,10 @@ We expect authentic engagement in our community.
196197
- If you use generative AI tools as an aid in developing code or documentation
197198
changes, ensure that you fully understand the proposed changes and can
198199
explain why they are the correct approach.
200+
- If you use AI for translation or grammar correction, please keep the wording as close
201+
as possible to the original wording. It is much easier to come to a mutual
202+
understanding when we are working off a direct translation of your words/thoughts
203+
rather than a text an LLM may have embellished with possibly spurious information.
199204

200205
Make sure you have added value based on your personal competency to your
201206
contributions. Just taking some input, feeding it to an AI and posting the
@@ -260,23 +265,14 @@ To join, please go to our public `community gitter`_ channel, and ask to be adde
260265
Good first issues
261266
-----------------
262267

263-
While any contributions are welcome, we have marked some issues as
264-
particularly suited for new contributors by the label `good first issue
265-
<https://github.com/matplotlib/matplotlib/labels/good%20first%20issue>`_. These
266-
are well documented issues, that do not require a deep understanding of the
267-
internals of Matplotlib. The issues may additionally be tagged with a
268-
difficulty. ``Difficulty: Easy`` is suited for people with little Python
269-
experience. ``Difficulty: Medium`` and ``Difficulty: Hard`` require more
270-
programming experience. This could be for a variety of reasons, among them,
271-
though not necessarily all at the same time:
272-
273-
- The issue is in areas of the code base which have more interdependencies,
274-
or legacy code.
275-
- It has less clearly defined tasks, which require some independent
276-
exploration, making suggestions, or follow-up discussions to clarify a good
277-
path to resolve the issue.
278-
- It involves Python features such as decorators and context managers, which
279-
have subtleties due to our implementation decisions.
268+
We have marked some issues as `good first issue
269+
<https://github.com/matplotlib/matplotlib/labels/good%20first%20issue>`_ because we
270+
think they are a good entry point into the process of contributing to Matplotlib. These
271+
issues are well documented, do not require a deep understanding of the internals of
272+
Matplotlib, and do not need urgent resolution. Good first issues are intended to onboard
273+
newcomers with a genuine interest in improving Matplotlib, in the hopes that they will
274+
continue to participate in our development community; therefore, pull requests that are
275+
:ref:`AI generated <generative_ai>` will be closed.
280276

281277
.. _first_contribution:
282278

@@ -292,7 +288,12 @@ guide you through each step:
292288
& `"Good first Issue" <https://github.com/matplotlib/matplotlib/labels/good%20first%20issue>`_ (optional).
293289
3. Click on an issue you would like to work on, and check to see if the issue has a pull request opened to resolve it.
294290

295-
* A good way to judge if you chose a suitable issue is by asking yourself, "Can I independently submit a PR in 1-2 weeks?"
291+
* A good way to judge if you chose a suitable issue is by asking yourself, "Can I
292+
independently submit a PR in a reasonable time frame?" This should (at most)
293+
be a few days for an easy issue. If it takes longer, let us know why.
294+
* If you are new to open source, we strongly recommend that you do not choose a
295+
complicated issue for your first contribution - please ask in the incubator
296+
channel if you need help gauging the complexity of the work.
296297
4. Check existing pull requests (e.g., :ghpull:`28476`) and filter by the issue number to make sure the issue is not in progress:
297298

298299
* If the issue has a pull request (is in progress), tag the user working on the issue, and ask to collaborate (optional).
@@ -334,6 +335,22 @@ a new PR; duplicate PRs are subject to being closed. However, if the existing
334335
PR is an outline, unlikely to work, or stalled, and the original author is
335336
unresponsive, feel free to open a new PR referencing the old one.
336337

338+
Difficulty
339+
----------
340+
Issues may additionally be tagged with a difficulty. ``Difficulty: Easy`` is suitable
341+
for people with beginner scientific Python experience, i.e. fluency with Python syntax
342+
and some experience using libraries like Numpy, Pandas, or Xarray. ``Difficulty: Medium``
343+
and ``Difficulty: Hard`` require more programming experience. This could be for a variety
344+
of reasons, for example:
345+
346+
- requires understanding intermediate to advanced Python features, such as decorators,
347+
context managers, or meta-programming
348+
- is in areas of the code base which have more interdependencies or is legacy code.
349+
- involves complex or significant changes to algorithms or architecture.
350+
351+
Generally, the difficulty level is correlated with how much conceptual (and contextual)
352+
understanding of Matplotlib is required to resolve it.
353+
337354
.. _how-to-pull-request:
338355

339356
Start a pull request

doc/devel/testing.rst

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ In the root directory of your development repository run::
5252
``--capture=no`` or ``-s`` Do not capture stdout
5353
============================= ===========
5454

55+
Some tests may use a large amount of memory (>0.5GiB); to enable those tests, set the
56+
environment variable ``MPL_TEST_EXPENSIVE``.
57+
5558
To run a single test from the command line, you can provide a file path, optionally
5659
followed by the function separated by two colons, e.g., (tests do not need to be
5760
installed, but Matplotlib should be)::
@@ -147,8 +150,8 @@ tests it::
147150
from matplotlib.testing.decorators import image_comparison
148151
import matplotlib.pyplot as plt
149152

150-
@image_comparison(baseline_images=['line_dashes'], remove_text=True,
151-
extensions=['png'], style='mpl20')
153+
@image_comparison(baseline_images=['line_dashes.png'], remove_text=True,
154+
style='mpl20')
152155
def test_line_dashes():
153156
fig, ax = plt.subplots()
154157
ax.plot(range(10), linestyle=(0, (3, 3)), lw=5)
@@ -161,6 +164,15 @@ case :file:`lib/matplotlib/tests/baseline_images/test_lines`). Put this new
161164
file under source code revision control (with ``git add``). When rerunning
162165
the tests, they should now pass.
163166

167+
If you wish to compare multiple file formats, then omit the extension from the
168+
baseline image name and optionally pass the *extensions* argument::
169+
170+
@image_comparison(baseline_images=['line_dashes'], remove_text=True,
171+
extensions=['png', 'svg'], style='mpl20')
172+
def test_line_dashes():
173+
fig, ax = plt.subplots()
174+
ax.plot(range(10), linestyle=(0, (3, 3)), lw=5)
175+
164176
It is preferred that new tests use ``style='mpl20'`` as this leads to smaller
165177
figures and reflects the newer look of default Matplotlib plots. Also, if the
166178
texts (labels, tick labels, etc) are not really part of what is tested, use the

doc/release/next_whats_new/README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ Instructions for writing "What's new" entries
1111
=============================================
1212
.. whats-new-guide-start
1313
14-
Each new feature (e.g. function, parameter, config value, behavior, ...) must
15-
be described through a "What's new" entry.
14+
Each new feature (e.g. function, parameter, rcParam, config value, behavior,
15+
...) must be described through a "What's new" entry.
1616

1717
Each entry is written into a separate file in the
1818
:file:`doc/release/next_whats_new/` directory. They are sorted and merged into

0 commit comments

Comments
 (0)