Skip to content
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

ENH better error message for wrong fontsize #4159

Merged
merged 1 commit into from Feb 28, 2015
Merged

ENH better error message for wrong fontsize #4159

merged 1 commit into from Feb 28, 2015

Conversation

NelleV
Copy link
Member

@NelleV NelleV commented Feb 25, 2015

When the fontsize provided is unknown to matplotlib, the error raised now
contains the list of known fontsize.

@mdboom
Copy link
Member

mdboom commented Feb 25, 2015

👍

@@ -899,7 +899,9 @@ def set_size(self, size):
size = float(size)
except ValueError:
if size is not None and size not in font_scalings:
raise ValueError("size is invalid")
raise ValueError(
"Size is invalid. Valid font size are" + ", ".join(
Copy link
Member

Choose a reason for hiding this comment

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

super picky: I think you need a trailing space after 'are' and I don't think you need the [] in the generator.

Copy link
Member Author

Choose a reason for hiding this comment

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

Don't you need [] for python 2.6 ?

Copy link
Member

Choose a reason for hiding this comment

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

Oh, maybe. Ignore my comment if that is the case.

Copy link
Member Author

Choose a reason for hiding this comment

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

I just tested and it works without it.

Copy link
Member

Choose a reason for hiding this comment

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

I think so. I can't remember. Better safe than sorry.

On Wed, Feb 25, 2015 at 12:13 PM, Thomas A Caswell <notifications@github.com

wrote:

In lib/matplotlib/font_manager.py
#4159 (comment):

@@ -899,7 +899,9 @@ def set_size(self, size):
size = float(size)
except ValueError:
if size is not None and size not in font_scalings:

  •            raise ValueError("size is invalid")
    
  •            raise ValueError(
    
  •                "Size is invalid. Valid font size are" + ", ".join(
    

Oh, maybe. Ignore my comment if that is the case.


Reply to this email directly or view it on GitHub
https://github.com/matplotlib/matplotlib/pull/4159/files#r25358324.

When the fontsize provided is unknown to matplotlib, the error raised now
contains the list of known fontsize.
@NelleV
Copy link
Member Author

NelleV commented Feb 25, 2015

Everything is fixed.

@tacaswell tacaswell added this to the next point release milestone Feb 25, 2015
@tacaswell
Copy link
Member

Thanks! I'll merge as soon as travis finishes.

efiring added a commit that referenced this pull request Feb 28, 2015
ENH better error message for wrong fontsize
@efiring efiring merged commit 2de5c33 into matplotlib:master Feb 28, 2015
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.

None yet

5 participants