8000 MNT: Issue a warning instead of logging if RGB(A) passed to scatter(..., c) by timhoffm · Pull Request #24430 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

MNT: Issue a warning instead of logging if RGB(A) passed to scatter(..., c) #24430

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 14, 2022

Conversation

timhoffm
Copy link
Member

When to use what:

  • warnings.warn() in library code if the issue is avoidable and the client application should be modified to eliminate the warning
  • logging.warning() if there is nothing the client application can do about the situation, but the event should still be noted

There are unambiguous ways for the user to specify the color (see the message). Here, the user should take action and switch from using c to using color. Thus warnings.warn() is the way to go.

Closes half of #23422.

@timhoffm timhoffm added this to the v3.7.0 milestone Nov 11, 2022
@timhoffm timhoffm force-pushed the scatter-warn branch 2 times, most recently from ae1496a to 62c3ad4 Compare November 12, 2022 00:29
 c)

When to use what:

- warnings.warn() in library code if the issue is avoidable and the
  client application should be modified to eliminate the warning
- logging.warning() if there is nothing the client application can
  do about the situation, but the event should still be noted

There are unambiguous ways for the user to specify the color (see the
message). Here, the user should take action and switch from using *c*
to using *color*. Thus warnings.warn() is the way to go.

Closes half of matplotlib#23422.
@tacaswell
Copy link
Member

@timhoffm Can you also put that guidance in the docs?

@tacaswell
Copy link
Member

The appveyor failure is the on-going one correct? If so anyone can merge.

@jklymak jklymak merged commit 500967b into matplotlib:main Nov 14, 2022
@timhoffm timhoffm deleted the scatter-warn branch November 14, 2022 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0