Skip to content

Pdf color none #8850

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

Merged
merged 4 commits into from
Jul 11, 2017
Merged

Pdf color none #8850

merged 4 commits into from
Jul 11, 2017

Conversation

tacaswell
Copy link
Member

Replaces #8674

@tacaswell tacaswell added this to the 2.1 (next point release) milestone Jul 8, 2017
@@ -191,3 +193,17 @@ def psfont(*args, **kwargs):
ax.text(0.5, 0.5, 'hello')
with tempfile.TemporaryFile() as tmpfile, pytest.raises(ValueError):
fig.savefig(tmpfile, format='pdf')


def test_pdf_savefig_when_color_is_none(tempdir_factory):
Copy link
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.

Copy link
Contributor

@anntzer anntzer Jul 8, 2017

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
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
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


@pytest.mark.style('default')
def test_pdf_savefig_when_color_is_none(tmpdir_factory):
Copy link
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
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
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
Member Author

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

@@ -355,8 +355,8 @@ def crop_to_same(actual_path, actual_image, expected_path, expected_image):
# clip the images to the same size -- this is useful only when
# comparing eps to pdf
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
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
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
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
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