8000 MAINT: Deterministic SVG and PDF tests by jkseppan · Pull Request #7748 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

MAINT: Deterministic SVG and PDF tests #7748

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 7 commits into from
Jan 21, 2017
Merged
Changes from 1 commit
Commits
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
Document the changes in whats_new
  • Loading branch information
jkseppan committed Jan 5, 2017
commit eab297c8717e9815bb7a2ee18e3c83d586b37ea4
16 changes: 14 additions & 2 deletions doc/users/whats_new/reproducible_ps_pdf.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
Reproducible PS and PDF output
------------------------------
Reproducible PS, PDF and SVG output
-----------------------------------

The ``SOURCE_DATE_EPOCH`` environment variable can now be used to set
the timestamp value in the PS and PDF outputs. See
https://reproducible-builds.org/specs/source-date-epoch/

Alternatively, calling ``savefig`` with ``metadata={creationDate=None}``
Copy link
Member

Choose a reason for hiding this comment

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

This dict literal is a bit broken; should be dict(creationDate=None) or {'creationDate': None}.

will omit the timestamp altogether.

The reproducibility of the output from the PS and PDF backends has so
far been tested using various plot elements but only default values of
options such as ``{ps,pdf}.fonttype`` that can affect the output at a
low level, and not with the mathtext or usetex features. When
matplotlib calls external tools (such as PS distillers or LaTeX) their
versions need to be kept constant for reproducibility, and they may
add sources of nondeterminism outside the control of matplotlib.

For SVG output, the ``svg.hashsalt`` rc parameter has been added in an
earlier release. In can be used to change some random id values in the
Copy link
Member

Choose a reason for hiding this comment

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

In -> It

output to be deterministic, at the cost that including multiple such
svg files in one document can lead to collisions.
Copy link
Member

Choose a reason for hiding this comment

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

svg -> SVG


These features are now enabled in the tests for the pdf and svg
Copy link
Member

Choose a reason for hiding this comment

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

pdf -> PDF
svg -> SVG

backends, so most test output files (but not all of them) are now
deterministic.
0