[yt-svn] commit/yt: 2 new changesets
Bitbucket
commits-noreply at bitbucket.org
Wed Sep 5 11:03:06 PDT 2012
2 new commits in yt:
https://bitbucket.org/yt_analysis/yt/changeset/6e2b0aaf5fce/
changeset: 6e2b0aaf5fce
branch: yt
user: xarthisius
date: 2012-09-05 17:37:15
summary: Remove unused bits from PlotCollection:save_book and write metadata to pdf file. Partialy fixes #228
affected #: 1 file
diff -r 0c844cb7df71949206ff497c57ef437d6429d58e -r 6e2b0aaf5fce04d5acb6b1fd0eac4a503fbed78f yt/visualization/plot_collection.py
--- a/yt/visualization/plot_collection.py
+++ b/yt/visualization/plot_collection.py
@@ -1533,7 +1533,7 @@
@rootonly
def save_book(self, filename, author = None, title = None, keywords = None,
subject = None, creator = None, producer = None,
- creation_data = None):
+ creation_date = None):
r"""Save a multipage PDF of all the current plots, rather than
individual image files.
@@ -1580,15 +1580,21 @@
>>> dd = pf.h.all_data()
>>> pc.add_phase_object(dd, ["Density", "Temperature", "CellMassMsun"],
... weight = None)
- >>> pc.save_book("my_plots.pdf", author="Matthew Turk",
+ >>> pc.save_book("my_plots.pdf", author="Matthew Turk",
... title="Fun plots")
"""
from matplotlib.backends.backend_pdf import PdfPages
outfile = PdfPages(filename)
for plot in self.plots:
plot.save_to_pdf(outfile)
- if info is not None:
- outfile._file.writeObject(outfile._file.infoObject, info)
+ pdf_keys = ['Title', 'Author', 'Subject', 'Keywords', 'Creator',
+ 'Producer', 'CreationDate']
+ pdf_values = [title, author, subject, keywords, creator, producer,
+ creation_date]
+ metadata = outfile.infodict()
+ for key, val in zip(pdf_keys, pdf_values):
+ if isinstance(val, str):
+ metadata[key] = val
outfile.close()
def wrap_pylab_newplot(func):
https://bitbucket.org/yt_analysis/yt/changeset/1a3c927ef00c/
changeset: 1a3c927ef00c
branch: yt
user: xarthisius
date: 2012-09-05 20:00:50
summary: Add 'proper' author to docstring
affected #: 1 file
diff -r 6e2b0aaf5fce04d5acb6b1fd0eac4a503fbed78f -r 1a3c927ef00cd6469864c6b8759c3574805ad092 yt/visualization/plot_collection.py
--- a/yt/visualization/plot_collection.py
+++ b/yt/visualization/plot_collection.py
@@ -1580,7 +1580,7 @@
>>> dd = pf.h.all_data()
>>> pc.add_phase_object(dd, ["Density", "Temperature", "CellMassMsun"],
... weight = None)
- >>> pc.save_book("my_plots.pdf", author="Matthew Turk",
+ >>> pc.save_book("my_plots.pdf", author="Yours Truly",
... title="Fun plots")
"""
from matplotlib.backends.backend_pdf import PdfPages
Repository URL: https://bitbucket.org/yt_analysis/yt/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the yt-svn
mailing list