Skip to content

Commit

Permalink
Merge pull request #61 from nschloe/fix-relative-to
Browse files Browse the repository at this point in the history
Fix relative to
  • Loading branch information
nschloe authored Nov 25, 2019
2 parents 9214426 + 6ae4952 commit 4579a2f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion perfplot/__about__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
__author_email__ = "nico.schloemer@gmail.com"
__copyright__ = "Copyright (c) 2017-2019, {} <{}>".format(__author__, __author_email__)
__license__ = "License :: OSI Approved :: MIT License"
__version__ = "0.6.8"
__version__ = "0.6.9"
__status__ = "Development Status :: 5 - Production/Stable"
5 changes: 4 additions & 1 deletion perfplot/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def plot(
# correspond to the order of the lines.
order = numpy.argsort(self.timings[:, -1])[::-1]
if relative_to is not None:
relative_to = order[relative_to]
relative_to = numpy.where(order == relative_to)[0][0]
self.timings = self.timings[order]
self.labels = [self.labels[i] for i in order]
self.colors = [self.colors[i] for i in order]
Expand Down Expand Up @@ -159,6 +159,9 @@ def bench(
relative_to = kernels[0](data)
for k, kernel in enumerate(tqdm(kernels, leave=(i == len(n_range) - 1))):
if equality_check:
assert kernel(data) is not None, "{} returned None".format(
labels[k]
)
assert equality_check(
relative_to, kernel(data)
), "Equality check failure. ({}, {})".format(labels[0], labels[k])
Expand Down

0 comments on commit 4579a2f

Please sign in to comment.