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 from11 commits
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
24 changes: 12 additions & 12 deletionslib/matplotlib/tests/test_axes.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2919,8 +2919,8 @@ 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 # pragma: no cover
def get_next_color(): # pragma: no cover
return 'blue' # currently unused

xsize = 4
# Additional checking of *c* (introduced in #11383).
Expand DownExpand Up@@ -3013,8 +3013,8 @@ def _params(c=None, xsize=2, *, edgecolors=None, **kwargs):
_result(c=['b', 'g'], colors=np.array([[0, 0, 1, 1], [0, .5, 0, 1]]))),
])
def test_parse_scatter_color_args(params, expected_result):
def get_next_color():
return 'blue' # currently unused # pragma: no cover
def get_next_color(): # pragma: no cover
return 'blue' # currently unused

c, colors, _edgecolors = mpl.axes.Axes._parse_scatter_color_args(
*params, get_next_color_func=get_next_color)
Expand All@@ -3040,8 +3040,8 @@ def get_next_color():
(dict(color='r', edgecolor='g'), 'g'),
])
def test_parse_scatter_color_args_edgecolors(kwargs, expected_edgecolors):
def get_next_color():
return 'blue' # currently unused # pragma: no cover
def get_next_color(): # pragma: no cover
return 'blue' # currently unused

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


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

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

# Test with facecolors (plural)
with pytest.warns(UserWarning, match=WARN_MSG):
Expand DownExpand Up@@ -9072,8 +9072,8 @@ def test_child_axes_removal():

def test_scatter_color_repr_error():

def get_next_color():
return 'blue' #pragma: no cover
def get_next_color(): # pragma: no cover
return 'blue' #currently unused
msg = (
r"'c' argument must be a color, a sequence of colors"
r", or a sequence of numbers, not 'red\\n'"
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp