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

Patch for issue #6009#6014

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

Conversation

afvincent
Copy link
Contributor

Here is a patch for issue#6009 about the EngFormatter in matplotlib.ticker.

It simply enforces a space when there is no SI prefix but yet a unit symbol. For example “10 seconds” should be formatted as “10 s” by the EngFormatter (previously “10s”).

@WeatherGod
Copy link
Member

Should add a unit test to exercise this. Preferably not an image test (we have plenty of those), but one that tests the strings coming out of EngFormatter.

@tacaswelltacaswell added this to the2.1 (next point release) milestoneFeb 18, 2016
@@ -960,7 +960,11 @@ def format_eng(self, num):

formatted = format_str % (mant, prefix)

return formatted.strip()
formatted = formatted.strip()
if (self.unit is not "") and (prefix is self.ENG_PREFIXES[0]):
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 this should be== notis. It is just a little less brittle.

@tacaswell
Copy link
Member

Left minor comment, but other wise 👍

@afvincent
Copy link
ContributorAuthor

I don't understand why my last commit broke the Travis CI build test: it seems to me that the changes are really minor, aren't they? Furthermore, when looking at the failure logs in “Details” section of Travis, one can find errors likeFAIL: matplotlib.tests.test_colorbar.test_colorbar_closed_patch.test and all the 6 (unexpected) failures relate totest_colorbar. How can it be impacted by a change inticker.EngFormatter?

@jenshnielsen
Copy link
Member

Travis is broken because the merge of another pr broke master is is not caused by your pr

@afvincent
Copy link
ContributorAuthor

Ok, thank you for the explanation :).

@tacaswell
Copy link
Member

Can you rebase so we can merge it?

@afvincent
Copy link
ContributorAuthor

I think I've done a mistake on this branch with my git local repo (what a change…). I used the same branch to implement the enhancement I presented in#6533 (which also fix this issue btw). Should I go back in time with git and then rebase, or do something else? I guess opening a new PR (on a branch from an up-to-date master) which fixes this small issue and also implements thespace_sep new option isn't really a clean option, is it?

Hope it is what was expected when asking for some unit (non image) test.
Sorry, I was using a different name than “mticker” to import the ticker module, and I had forgotten to change it when committing the new unit test test_EngFormatter_formatting()…
Now “All right” on pep8online.com for the method format_eng in the class EngFormatter.
@afvincentafvincentforce-pushed theafvincent-patch-issue-6009 branch from5161bfa to6d584adCompareJune 5, 2016 13:39
@afvincent
Copy link
ContributorAuthor

I rebased after deleting my last commit (the one with the enhancement#6533). Hopefully it will be OK.

@tacaswelltacaswell merged commit0ac187d intomatplotlib:masterJun 6, 2016
tacaswell added a commit that referenced this pull requestJun 6, 2016
FIX: EngFormatter without but without prefixcloses#6009
@tacaswell
Copy link
Member

tacaswell commentedJun 6, 2016
edited
Loading

backported to v2.x as59e0ab9

@QuLogicQuLogic modified the milestones:2.0 (style change major release),2.1 (next point release)Jun 6, 2016
@afvincentafvincent deleted the afvincent-patch-issue-6009 branchJune 6, 2016 16:40
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
v2.0.0
Development

Successfully merging this pull request may close these issues.

6 participants
@afvincent@WeatherGod@tacaswell@jenshnielsen@mdboom@QuLogic

[8]ページ先頭

©2009-2025 Movatter.jp