-
Notifications
You must be signed in to change notification settings - Fork 280
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
Hotfix image filename validation #3176
Hotfix image filename validation #3176
Conversation
149aa7b
to
6cad08e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
(sorry for closing/reopening, that was a mistake!)
|
||
return f"{name}{suffix}" | ||
if suffix is None: | ||
suffix = ".png" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not?
suffix = ".png" | |
suffix = ytcfg.get("yt", "default_image_format") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ambivalent. I don't like having a parameter with "default" in its name, makes it a bit hard to know what we're talking about. That being said I like the idea of parametrising a "preferred" output format (though that name isn't perfect either). I'd like to think about this a bit more and maybe do it in a separate PR.
6cad08e
to
365610a
Compare
PR Summary
The following script has two bugs
1 - the logger contains a stupid entry (not meaning offense to anyone but myself, I authored it)
2 - the resulting file is named
1.2.png
, while it should clearly be1.2.3.png
(discovered this while trying to embed matplotlib version numbers in file names...)This fixes both these problems and provides better testing (yay, pytest !) for the culprit function.