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

MAINT: Updated tick and category test formatting#7993

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

madphysicist
Copy link
Contributor

@madphysicistmadphysicist commentedJan 30, 2017
edited
Loading

Rearranged tests inlib/matplotlib/tests/test_ticker.py and made a couple of very minor changes tolib/matplotlib/tests/test_category.py. Based on comment by@story645 in PRs#7482 and#7965.

This PR should probably be merged before either of the others so I can rebase them onto it and clean things up.

assert formatter.format_pct(x, display_range) == expected


class TestEndFormatter(object):
Copy link
Member

Choose a reason for hiding this comment

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

typo: EngFormatter

np.array(['1', '11', '3']),
[b'1', b'11', b'3'],
np.array([b'1', b'11', b'3'])],
]
Copy link
Member

@story645story645Jan 30, 2017
edited
Loading

Choose a reason for hiding this comment

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

apparently an extra ] here messing up travis?

@story645
Copy link
Member

😄 thanks!

@madphysicist
Copy link
ContributorAuthor

Thanks for looking through the PRs. I fixed up the issues you found.

@madphysicist
Copy link
ContributorAuthor

I am pretty sure that this PR is ready to go. The failing tests appear to be caused by an external source.

@madphysicistmadphysicistforce-pushed thetest-fixture-fixup branch 3 times, most recently from6d2c93f to37592a7CompareJanuary 30, 2017 22:16
@madphysicist
Copy link
ContributorAuthor

No more failing tests.

@madphysicistmadphysicistforce-pushed thetest-fixture-fixup branch 2 times, most recently fromf4b6f48 to37592a7CompareJanuary 31, 2017 14:50
@dstansbydstansby changed the titleMAINT: Updated tick and category test formatting[MRG+1] MAINT: Updated tick and category test formattingJan 31, 2017
@madphysicist
Copy link
ContributorAuthor

@dstansby. I've been seeing [MRG+1] a lot recently on PR titles. What does it mean?

@story645
Copy link
Member

It means your PR has been approved by one reviewer (matplotlib asks for 2 approvals before commiting).http://matplotlib.org/devel/coding_guide.html#pr-review-guidelines

@madphysicist
Copy link
ContributorAuthor

Can you be the other one?

cases, especially the case when no SI prefix is present, for values in
[1, 1000).

Should not raise exceptions.
Copy link
Member

Choose a reason for hiding this comment

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

don't need this comment.


Should not raise exceptions.
"""
unitless = mticker.EngFormatter()
Copy link
Member

Choose a reason for hiding this comment

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

these should probably be two separate tests (unitless and with unit) and possibly parameterized

@story645
Copy link
Member

Sorry thought I approved. Have two comments, but if you wanna punt those to a different improve engineering test PR, let me know and I'll merge.

@madphysicistmadphysicistforce-pushed thetest-fixture-fixup branch 2 times, most recently from9d8d3ab toe3f721fCompareJanuary 31, 2017 19:03
@madphysicist
Copy link
ContributorAuthor

@story645 I made the improvements here. I kept is as a single parametrized test, removed the extra comment and also took care of some extra whitespace in ticker.py.

@madphysicistmadphysicistforce-pushed thetest-fixture-fixup branch 2 times, most recently from85ee55b to5211dc9CompareJanuary 31, 2017 19:49
@madphysicist
Copy link
ContributorAuthor

Not an actual failure, Mac test just didn't run.

@QuLogic
Copy link
Member

With#7973 merged, this has conflicts. When you rebase, please be sure to leave out any emptycleanup decorators.

@story645
Copy link
Member

I think on the rebase or something, you accidentally introduced a conflict. Please resolve.

@madphysicist
Copy link
ContributorAuthor

@QuLogic Should I replace@cleanup(style='classic') with@pytest.mark.style('classic'), and make all similar changes that make sense?

@QuLogic
Copy link
Member

Classic is the default now, it's not necessary if that's really what's being used (and I realize I forgot to remove a couple.)

@madphysicist
Copy link
ContributorAuthor

In that case I will remove those too.

@madphysicist
Copy link
ContributorAuthor

Just to make triple sure, I should make the replacement for'default' though?

@QuLogic
Copy link
Member

That's correct.

@madphysicist
Copy link
ContributorAuthor

Done. I ended up parametrizing a couple of the tests and adding onepytest.mark.style('default') that I don't think was there before to make things pass. Should be good now.

@madphysicist
Copy link
ContributorAuthor

Again looks like Mac test didn't run. No actual failures.

@madphysicist
Copy link
ContributorAuthor

I've closed and reopened the PR to restart Travis and hopefully get the Mac test to run, but if you approve, this PR is ready to go.

9.441, 12.588])
assert_almost_equal(loc.tick_values(-7, 10), test_value)

def test_MultipleLocator_set_params(self):
Copy link
Member

Choose a reason for hiding this comment

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

Seems like you forgot to remove the class in this one.

fmt = ax.xaxis.get_major_formatter()
fmt.set_locs(ax.xaxis.get_majorticklocs())
show_major_labels = [fmt(x) != '' for x in
ax.xaxis.get_majorticklocs()]
Copy link
Member

Choose a reason for hiding this comment

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

Not aligned properly; better to wrap atfor.

@pytest.mark.parametrize(
'labelOnlyBase, exponent, locs, positions, expected', param_data)
@pytest.mark.parametrize('base', base_data)
def test_LogFormatterExponent(self, labelOnlyBase, base, exponent,
Copy link
Member

Choose a reason for hiding this comment

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

Class name is still here.



class TestLogFormatterSciNotation(object):
testdata = [
Copy link
Member

Choose a reason for hiding this comment

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

Whytestdata and nottest_data like the others?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I wasn't sure if it would cause any problems if I started it withtest_.

Copy link
Member

Choose a reason for hiding this comment

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

We'll see how the tests go, then, but I'd guess this shouldn't be a problem since it isn't callable.

@madphysicist
Copy link
ContributorAuthor

@QuLogic Made the following changes:

  • Removed 2 class names in method names.
  • Renamedtestdata totest_data.
  • Wrapped list comprehension withfor on new line.

@madphysicist
Copy link
ContributorAuthor

Ready to go?

@QuLogicQuLogic added this to the2.1 (next point release) milestoneFeb 2, 2017
@QuLogicQuLogic changed the title[MRG+1] MAINT: Updated tick and category test formattingMAINT: Updated tick and category test formattingFeb 2, 2017
@QuLogicQuLogic merged commit7ffcca9 intomatplotlib:masterFeb 2, 2017
@madphysicistmadphysicist deleted the test-fixture-fixup branchFebruary 2, 2017 22:29
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@story645story645story645 approved these changes

@QuLogicQuLogicQuLogic approved these changes

@dstansbydstansbydstansby approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
v2.1
Development

Successfully merging this pull request may close these issues.

4 participants
@madphysicist@story645@QuLogic@dstansby

[8]ページ先頭

©2009-2025 Movatter.jp