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

Skip to content

MAINT Better error message for number of colors versus number of data… #11876

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 2 commits into from
Aug 18, 2018

Conversation

NelleV
Copy link
Member

@NelleV NelleV commented Aug 17, 2018

Just changing slightly the error message when the number of colors don't match the number of datasets. Sometimes it's down deep after several functions, and it is hard to understand it without providing a bit more context.

raise ValueError("color kwarg must have one color per dataset")
error_message = (
"color kwarg must have one color per data sets. %d data "
"sets and %d colors were provided" % (len(color), nx))

Choose a reason for hiding this comment

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

Strictly, it would be "per data set" (singular). And one may finish the sentence with a period. I.e.

"The color kwarg must have one color per data set. %d data "
"sets and %d colors were provided." % (len(color), nx))

But yeah, that message would make it easier to see where things went wrong when calling the function.

Copy link
Member

@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

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

I agree with @ImportanceOfBeingErnest s comment. Apart from that this is good to go.

@jklymak jklymak merged commit 9f74ea7 into matplotlib:master Aug 18, 2018
@jklymak jklymak modified the milestones: v3.1, v3.0 Aug 18, 2018
@jklymak
Copy link
Member

jklymak commented Aug 18, 2018

@meeseeksdev backport to v3.0.x

lumberbot-app bot pushed a commit that referenced this pull request Aug 18, 2018
jklymak added a commit that referenced this pull request Aug 18, 2018
@NelleV NelleV deleted the better_error_message branch February 5, 2019 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants