Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Raise warning if both c and facecolors are used in scatter plot (... and related improvements in the test suite).#29130

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
story645 merged 21 commits intomatplotlib:mainfromNGWi:issue24404_addwarning
Jan 3, 2025
Merged
Changes from1 commit
Commits
Show all changes
21 commits
Select commitHold shift + click to select a range
5a26bb9
Raise warning if both c and facecolors are used in scatter plot. In t…
NGWiNov 12, 2024
f1966c2
Corrected flake8 formatting warnings.
NGWiNov 12, 2024
53a0825
Removed offending whitespace and extra line.
NGWiNov 13, 2024
a777a15
Merge branch 'issue24404_addwarning' of https://github.com/NGWi/matpl…
NGWiNov 13, 2024
8031809
Corrected old test that qualified for the new warning.
NGWiNov 13, 2024
8ae213c
Made message more concise, and straightened old test, to fulfill @tim…
NGWiNov 18, 2024
49f03f7
Added test.
NGWiNov 18, 2024
8234066
Corrected flake8 linting objections.
NGWiNov 18, 2024
38c092a
Added direct test of _parse method to attempt to make Codecov happy.
NGWiNov 18, 2024
e6e49aa
Added pragma tags for code coverage to ignore unused but untested sim…
NGWiDec 3, 2024
39e1899
Raise warning if both c and facecolors are used in scatter plot. In t…
NGWiNov 12, 2024
06c8a76
Corrected flake8 formatting warnings.
NGWiNov 12, 2024
72138c6
Corrected old test that qualified for the new warning.
NGWiNov 13, 2024
319b92b
Made message more concise, and straightened old test, to fulfill @tim…
NGWiNov 18, 2024
e348dfc
Added test.
NGWiNov 18, 2024
fcf6ce2
Corrected flake8 linting objections.
NGWiNov 18, 2024
9601975
Added direct test of _parse method to attempt to make Codecov happy.
NGWiNov 18, 2024
a18364c
Added pragma tags for code coverage to ignore unused but untested sim…
NGWiDec 3, 2024
310a15f
Corrected placement of pragma tags and added 'currently unused' to Je…
NGWiDec 4, 2024
7c01a7b
Tim's suggestion for naming test's list of colors.
NGWiDec 4, 2024
fd3d9db
Corrected call to changed variable name.
NGWiDec 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Added pragma tags for code coverage to ignore unused but untested sim…
…plified return.
  • Loading branch information
@NGWi
NGWi committedDec 4, 2024
commita18364c78bd6b93b33a99bcf7c5f7dcbf1a18ab4
10 changes: 5 additions & 5 deletionslib/matplotlib/tests/test_axes.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2920,7 +2920,7 @@ def test_scatter_different_shapes(self, fig_test, fig_ref):
@pytest.mark.parametrize('c_case, re_key', params_test_scatter_c)
def test_scatter_c(self, c_case, re_key):
def get_next_color():
return 'blue' # currently unused
return 'blue' # currently unused # pragma: no cover

xsize = 4
# Additional checking of *c* (introduced in #11383).
Expand DownExpand Up@@ -3014,7 +3014,7 @@ def _params(c=None, xsize=2, *, edgecolors=None, **kwargs):
])
def test_parse_scatter_color_args(params, expected_result):
def get_next_color():
return 'blue' # currently unused
return 'blue' # currently unused # pragma: no cover

c, colors, _edgecolors = mpl.axes.Axes._parse_scatter_color_args(
*params, get_next_color_func=get_next_color)
Expand All@@ -3041,7 +3041,7 @@ def get_next_color():
])
def test_parse_scatter_color_args_edgecolors(kwargs, expected_edgecolors):
def get_next_color():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
defget_next_color():
defget_next_color():# pragma no cover

Pretty sure it has to go next to the function declaration because you're telling coverage to ignore this whole block

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

You're right. That was my instinct as well, but I saw@jefromyers did it next to the return statement

return'blue'# pragma: no cover
(line 9076 in the current iteration).
I just corrected it.

return 'blue' # currently unused
return 'blue' # currently unused # pragma: no cover

c = kwargs.pop('c', None)
edgecolors = kwargs.pop('edgecolors', None)
Expand All@@ -3053,7 +3053,7 @@ def get_next_color():

def test_parse_scatter_color_args_error():
def get_next_color():
return 'blue' # currently unused
return 'blue' # currently unused # pragma: no cover

with pytest.raises(ValueError,
match="RGBA values should be within 0-1 range"):
Expand All@@ -3080,7 +3080,7 @@ def get_next_color():
def test_parse_c_facecolor_warning_direct(c, facecolor):
"""Test the internal _parse_scatter_color_args method directly."""
def get_next_color():
return 'blue'
return 'blue' # currently unused # pragma: no cover

# Test with facecolors (plural)
with pytest.warns(UserWarning, match=WARN_MSG):
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp