Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Reproducible PS/PDF output (master) #6597

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 31 commits into from Dec 9, 2016
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c6a4660
To allow reproducible output:
Jun 16, 2016
4e477dc
Reproducible PDF output: sort TTF characters
Jun 18, 2016
946ae45
Reproducible PDF output: sort fonts
Jun 18, 2016
22f71a2
Tests for determinist PDF output:
Jun 18, 2016
ad660d7
Share determinism test code for PS and PDF output.
Jun 27, 2016
37c28b4
Reproducible PS/tex output.
Jun 27, 2016
2e1c773
Removes test_source_date_epoch_tex test, since this is ghostscript de…
Jun 27, 2016
541f97e
PEP8
Jun 27, 2016
2a6ebc8
Add what's new section
Jul 7, 2016
6ee8967
Add some insight when test_source_date_epoch fails.
Jul 8, 2016
a3185e6
Allow parallel execution of test_backend_ps:test_determinism_all_tex …
Jul 8, 2016
8f095f6
Use subprocess for _test_source_date_epoch, to allow parallel calls (…
Jul 8, 2016
c007f49
Change SOURCE_DATE_EPOCH test date, to use two-digits numbers for mon…
Jul 11, 2016
ecbdd55
PEP8
Jul 11, 2016
65ec88e
Warnings about possible unreproducibility issues
Jul 12, 2016
5b405cc
Doc rephrasing, thanks to jkseppan.
Jul 12, 2016
d10a21e
Use explicit date formatting for PS backend timestamp, instead of asc…
Jul 12, 2016
da55bb6
Revert to 2000-01-01 for the SOURCE_DATE_EPOCH test date.
Jul 12, 2016
c56dae7
Use standard date format for PS timestamp
Jul 13, 2016
995173d
Rename functions in determinism.py to remove `test' keyword, since th…
Oct 4, 2016
eef6b12
TST: Use standard I/O for determinism tests.
QuLogic Oct 7, 2016
fb529da
TST: Remove multiple nested imports.
QuLogic Oct 7, 2016
ebff832
TST: Fix compatibility with Python 2.
QuLogic Oct 8, 2016
f6301c2
Merge pull request #1 from QuLogic/reproducible-master
Oct 8, 2016
1786555
Adds __future__ imports to testing/determinism.py
Oct 9, 2016
af4213e
Pass usetex setting to _determinism_save
Oct 11, 2016
bf7387e
Skip test using ghostscript, since failing may be due to ghostscript …
Oct 11, 2016
2cdc577
Forgot to change one timestamp format in c56dae7c52af50ceaca33ba14717…
Oct 11, 2016
76bec02
Reuse UTC timezone from dates.py
Nov 2, 2016
bbab0c5
Removes now useless option uid for _determinism_check
Nov 3, 2016
1a5ada6
Typo
Nov 3, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
TST: Fix compatibility with Python 2.
  • Loading branch information
QuLogic committed Oct 8, 2016
commit ebff832c6087cb2f646e94e6f3eb23afdcfc8dd0
10 changes: 9 additions & 1 deletion lib/matplotlib/testing/determinism.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Provides utilities to test output reproducibility.
"""

import six

import io
import os
import re
Expand Down Expand Up @@ -53,7 +55,13 @@ def _determinism_save(objects='mhi', format="pdf"):
x = range(5)
fig.add_subplot(1, 6, 6).plot(x, x)

fig.savefig(sys.stdout.buffer, format=format)
if six.PY2 and format == 'ps':
stdout = io.StringIO()
else:
stdout = getattr(sys.stdout, 'buffer', sys.stdout)
fig.savefig(stdout, format=format)
Copy link
Member

Choose a reason for hiding this comment

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

Why not just fig.savefig(getattr(sys.stdout, 'buffer', sys.stdout), format=format)?

Copy link
Member

Choose a reason for hiding this comment

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

It does not work with the PS backend, which tries to wrap the input in TextIOWrapper.

if six.PY2 and format == 'ps':
sys.stdout.write(stdout.getvalue())

# Restores SOURCE_DATE_EPOCH
if sde is None:
Expand Down