Skip to content

Pdf color none - #8850

Merged
dopplershift merged 4 commits into
matplotlib:masterfrom
tacaswell:pdf_color_none
Jul 11, 2017
Merged

dopplershift merged 4 commits into
matplotlib:masterfrom
tacaswell:pdf_color_none

Conversation

@tacaswell

Copy link
Copy Markdown
Member

Replaces #8674

@tacaswell tacaswell added this to the 2.1 (next point release) milestone Jul 8, 2017
fig.savefig(tmpfile, format='pdf')


def test_pdf_savefig_when_color_is_none(tempdir_factory):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The simpler tmpdir would be better here; don't see why it needs a factory.

@anntzer anntzer Jul 8, 2017 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't even see where tempdir_factory is defined? (even by pytest itself?)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Probably a typo, which is why it's not passing; should have been tmpdir_factory.



def test_pdf_savefig_when_color_is_none(tempdir_factory):
rcParams['_internal.classic_mode'] = False

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't know what this entails? It's neither classic nor default style now.

@tacaswell tacaswell mentioned this pull request Jul 10, 2017
2 tasks done


@pytest.mark.style('default')
def test_pdf_savefig_when_color_is_none(tmpdir_factory):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The tmpdir fixture is simpler...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

but then I have to sort out how to use it....

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just drop the .mktemp() since it's doing that for you.

@tacaswell

Copy link
Copy Markdown
Member Author

Squashed commits, simplified tests, and changed to use public API instead of private attributes.

if actual_path[-7:-4] == 'eps' and expected_path[-7:-4] == 'pdf':
aw, ah = actual_image.shape
ew, eh = expected_image.shape
aw, ah, ad = actual_image.shape

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What happened here? How would this have worked before?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@tacaswell

Copy link
Copy Markdown
Member Author

I am 👍 on merging this, but can not review a PR I opened (which sorta makes sense).

Anyone else who approves this should merge it.

@dopplershift
dopplershift merged commit 6847119 into matplotlib:master Jul 11, 2017
@tacaswell
tacaswell deleted the pdf_color_none branch July 11, 2017 18:11
@tacaswell

Copy link
Copy Markdown
Member Author

@Tuan333 Thanks for you work on this!

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