Skip to content

Commit

Permalink
Simplify series plotting test
Browse files Browse the repository at this point in the history
Extra lint
  • Loading branch information
mroeschke committed Nov 22, 2017
1 parent f40d7da commit b88f5e8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
5 changes: 2 additions & 3 deletions pandas/tests/plotting/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
""" Test cases for Series.plot """


import itertools
from itertools import chain
import pytest

from datetime import datetime
Expand Down Expand Up @@ -333,8 +333,7 @@ def test_pie_series(self):
autopct='%.2f', fontsize=7)
pcts = ['{0:.2f}'.format(s * 100)
for s in series.values / float(series.sum())]
iters = [iter(series.index), iter(pcts)]
expected_texts = [next(it) for it in itertools.cycle(iters)]
expected_texts = list(chain.from_iterable(zip(series.index, pcts)))
self._check_text_labels(ax.texts, expected_texts)
for t in ax.texts:
assert t.get_fontsize() == 7
Expand Down
12 changes: 6 additions & 6 deletions versioneer.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,11 +606,11 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose):
if verbose:
print("keywords are unexpanded, not using")
raise NotThisMethod("unexpanded keywords, not a git-archive tarball")
refs = set(r.strip() for r in refnames.strip("()").split(","))
refs = {r.strip() for r in refnames.strip("()").split(",")}
# starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of
# just "foo-1.0". If we see a "tag: " prefix, prefer those.
TAG = "tag: "
tags = set(r[len(TAG):] for r in refs if r.startswith(TAG))
tags = {r[len(TAG):] for r in refs if r.startswith(TAG)}
if not tags:
# Either we're using git < 1.8.3, or there really are no tags. We use
# a heuristic: assume all version tags have a digit. The old git %%d
Expand All @@ -619,7 +619,7 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose):
# between branches and tags. By ignoring refnames without digits, we
# filter out many common branch names like "release" and
# "stabilization", as well as "HEAD" and "master".
tags = set(r for r in refs if re.search(r'\d', r))
tags = {r for r in refs if re.search(r'\d', r)}
if verbose:
print("discarding '%%s', no digits" %% ",".join(refs-tags))
if verbose:
Expand Down Expand Up @@ -960,11 +960,11 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose):
if verbose:
print("keywords are unexpanded, not using")
raise NotThisMethod("unexpanded keywords, not a git-archive tarball")
refs = set(r.strip() for r in refnames.strip("()").split(","))
refs = {r.strip() for r in refnames.strip("()").split(",")}
# starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of
# just "foo-1.0". If we see a "tag: " prefix, prefer those.
TAG = "tag: "
tags = set(r[len(TAG):] for r in refs if r.startswith(TAG))
tags = {r[len(TAG):] for r in refs if r.startswith(TAG)}
if not tags:
# Either we're using git < 1.8.3, or there really are no tags. We use
# a heuristic: assume all version tags have a digit. The old git %d
Expand All @@ -973,7 +973,7 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose):
# between branches and tags. By ignoring refnames without digits, we
# filter out many common branch names like "release" and
# "stabilization", as well as "HEAD" and "master".
tags = set(r for r in refs if re.search(r'\d', r))
tags = {r for r in refs if re.search(r'\d', r)}
if verbose:
print("discarding '%s', no digits" % ",".join(refs-tags))
if verbose:
Expand Down

0 comments on commit b88f5e8

Please sign in to comment.