Skip to content

Convert docstring of Axes.pie() into numpydoc #8357

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

Closed
wants to merge 22 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
ea9250d
numpydocstring added
kahnchana Mar 21, 2017
d4d912b
.
kahnchana Mar 21, 2017
ce79bfe
Merge remote-tracking branch 'refs/remotes/matplotlib/master' into do…
kahnchana Mar 22, 2017
492b0ac
Revert "numpydocstring added"
kahnchana Mar 22, 2017
50aa3ff
Docstring to Numpydoc
kahnchana Mar 22, 2017
17570af
Merge remote-tracking branch 'refs/remotes/matplotlib/master'
kahnchana Mar 22, 2017
9b6c50b
Merge remote-tracking branch 'refs/remotes/origin/master' into docstring
kahnchana Mar 22, 2017
8df19bd
FIX small nitpicks
kahnchana Mar 22, 2017
f570978
removed duplicate matplotlib.transforms import
sindunuragarp Mar 16, 2017
027cbae
Standardized matplotlib transforms import
sindunuragarp Mar 19, 2017
34f688b
Reconfigured line to comply with pep8 length
sindunuragarp Mar 20, 2017
03bacb8
Removed additional pep8 e501 error caused by mtransforms
sindunuragarp Mar 21, 2017
465a453
STY: pep8 cleanup
tacaswell Mar 10, 2017
6e451f1
MNT: explicitly pass in file handle to print_figure_impl
tacaswell Mar 10, 2017
710b509
FIX: always remove the temporary file in eps print_figure
tacaswell Mar 10, 2017
9f53b14
STY: pep8 clean up
tacaswell Mar 10, 2017
b9ff429
FIX: always remove the temporary file in eps print_figure_tex
tacaswell Mar 10, 2017
c3d012a
Revert "numpydocstring added"
kahnchana Mar 22, 2017
d12a3cd
Docstring to Numpydoc
kahnchana Mar 22, 2017
0b4909a
FIX small nitpicks
kahnchana Mar 22, 2017
8e54067
Merge branch 'docstring' of https://github.com/kahnchana/matplotlib i…
kahnchana Mar 22, 2017
a0c7bd8
Made style changes and edits suggested
kahnchana Mar 22, 2017
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
STY: pep8 cleanup
  • Loading branch information
tacaswell authored and kahnchana committed Mar 22, 2017
commit 465a4539ef3a598da2f1a250fdae25ea011f27ea
54 changes: 35 additions & 19 deletions lib/matplotlib/backends/backend_ps.py
Original file line number Diff line number Diff line change
Expand Up @@ -1068,39 +1068,46 @@ def write(self, *kl, **kwargs):
else:
creator_str = "matplotlib version " + __version__ + \
", http://matplotlib.org/"

def print_figure_impl():
# write the PostScript headers
if isEPSF: print("%!PS-Adobe-3.0 EPSF-3.0", file=fh)
else: print("%!PS-Adobe-3.0", file=fh)
if title: print("%%Title: "+title, file=fh)
if isEPSF:
print("%!PS-Adobe-3.0 EPSF-3.0", file=fh)
else:
print("%!PS-Adobe-3.0", file=fh)
if title:
print("%%Title: "+title, file=fh)
print("%%Creator: " + creator_str, file=fh)
# get source date from SOURCE_DATE_EPOCH, if set
# See https://reproducible-builds.org/specs/source-date-epoch/
source_date_epoch = os.getenv("SOURCE_DATE_EPOCH")
if source_date_epoch:
source_date = datetime.datetime.utcfromtimestamp(
int(source_date_epoch) ).strftime("%a %b %d %H:%M:%S %Y")
int(source_date_epoch)).strftime("%a %b %d %H:%M:%S %Y")
else:
source_date = time.ctime()
print("%%CreationDate: "+source_date, file=fh)
print("%%Orientation: " + orientation, file=fh)
if not isEPSF: print("%%DocumentPaperSizes: "+papertype, file=fh)
if not isEPSF:
print("%%DocumentPaperSizes: "+papertype, file=fh)
print("%%%%BoundingBox: %d %d %d %d" % bbox, file=fh)
if not isEPSF: print("%%Pages: 1", file=fh)
if not isEPSF:
print("%%Pages: 1", file=fh)
print("%%EndComments", file=fh)

Ndict = len(psDefs)
print("%%BeginProlog", file=fh)
if not rcParams['ps.useafm']:
Ndict += len(ps_renderer.used_characters)
print("/mpldict %d dict def"%Ndict, file=fh)
print("/mpldict %d dict def" % Ndict, file=fh)
print("mpldict begin", file=fh)
for d in psDefs:
d=d.strip()
d = d.strip()
for l in d.split('\n'):
print(l.strip(), file=fh)
if not rcParams['ps.useafm']:
for font_filename, chars in six.itervalues(ps_renderer.used_characters):
for font_filename, chars in six.itervalues(
ps_renderer.used_characters):
if len(chars):
font = get_font(font_filename)
glyph_ids = []
Expand All @@ -1120,21 +1127,29 @@ def print_figure_impl():
# STIX fonts). This will simply turn that off to avoid
# errors.
if is_opentype_cff_font(font_filename):
raise RuntimeError("OpenType CFF fonts can not be saved using the internal Postscript backend at this time.\nConsider using the Cairo backend.")
msg = ("OpenType CFF fonts can not be saved "
"using the internal Postscript backend "
"at this time.\nConsider using the "
"Cairo backend.")
raise RuntimeError(msg)
else:
fh.flush()
convert_ttf_to_ps(
font_filename.encode(sys.getfilesystemencoding()),
font_filename.encode(
sys.getfilesystemencoding()),
fh, fonttype, glyph_ids)
print("end", file=fh)
print("%%EndProlog", file=fh)

if not isEPSF: print("%%Page: 1 1", file=fh)
if not isEPSF:
print("%%Page: 1 1", file=fh)
print("mpldict begin", file=fh)
#print >>fh, "gsave"
print("%s translate"%_nums_to_str(xo, yo), file=fh)
if rotation: print("%d rotate"%rotation, file=fh)
print("%s clipbox"%_nums_to_str(width*72, height*72, 0, 0), file=fh)

print("%s translate" % _nums_to_str(xo, yo), file=fh)
if rotation:
print("%d rotate" % rotation, file=fh)
print("%s clipbox" % _nums_to_str(width*72, height*72, 0, 0),
file=fh)

# write the figure
content = self._pswriter.getvalue()
Expand All @@ -1143,10 +1158,10 @@ def print_figure_impl():
print(content, file=fh)

# write the trailer
#print >>fh, "grestore"
print("end", file=fh)
print("showpage", file=fh)
if not isEPSF: print("%%EOF", file=fh)
if not isEPSF:
print("%%EOF", file=fh)
fh.flush()

if rcParams['ps.usedistiller']:
Expand All @@ -1161,8 +1176,9 @@ def print_figure_impl():
requires_unicode = file_requires_unicode(outfile)

if (not requires_unicode and
(six.PY3 or not isinstance(outfile, StringIO))):
(six.PY3 or not isinstance(outfile, StringIO))):
fh = io.TextIOWrapper(outfile, encoding="latin-1")

# Prevent the io.TextIOWrapper from closing the
# underlying file
def do_nothing():
Expand Down