Skip to content

Commit fcba67b

Browse files
authored
Merge pull request #134 from nschloe/matplotx
dufte -> matplotx
2 parents fc4cc19 + b41ce9f commit fcba67b

File tree

6 files changed

+18
-17
lines changed

6 files changed

+18
-17
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
runs-on: ubuntu-latest
2424
strategy:
2525
matrix:
26-
python-version: ["3.7", "3.8", "3.9", "3.10-dev"]
26+
python-version: ["3.7", "3.8", "3.9", "3.10"]
2727
steps:
2828
- uses: actions/setup-python@v2
2929
with:
@@ -34,4 +34,4 @@ jobs:
3434
pip install tox
3535
tox -- --cov perfplot --cov-report xml --cov-report term
3636
- uses: codecov/codecov-action@v1
37-
if: ${{ matrix.python-version == '3.9' }}
37+
if: ${{ matrix.python-version == '3.10' }}

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
[![PyPi Version](https://img.shields.io/pypi/v/perfplot.svg?style=flat-square)](https://pypi.org/project/perfplot)
66
[![PyPI pyversions](https://img.shields.io/pypi/pyversions/perfplot.svg?style=flat-square)](https://pypi.org/pypi/perfplot/)
77
[![GitHub stars](https://img.shields.io/github/stars/nschloe/perfplot.svg?style=flat-square&logo=github&label=Stars&logoColor=white)](https://github.com/nschloe/perfplot)
8-
[![PyPi downloads](https://img.shields.io/pypi/dm/perfplot.svg?style=flat-square)](https://pypistats.org/packages/perfplot)
8+
[![Downloads](https://pepy.tech/badge/perfplot/month)](https://pepy.tech/project/perfplot)
9+
<!--[![PyPi downloads](https://img.shields.io/pypi/dm/perfplot.svg?style=flat-square)](https://pypistats.org/packages/perfplot)-->
910

1011
[![Discord](https://img.shields.io/static/v1?logo=discord&label=chat&message=on%20discord&color=7289da&style=flat-square)](https://discord.gg/hnTJ5MRX2Y)
1112

justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ default:
77

88
tag:
99
@if [ "$(git rev-parse --abbrev-ref HEAD)" != "main" ]; then exit 1; fi
10-
curl -H "Authorization: token `cat ~/.github-access-token`" -d '{"tag_name": "{{version}}"}' https://api.github.com/repos/nschloe/{{name}}/releases
10+
curl -H "Authorization: token `cat ~/.github-access-token`" -d '{"tag_name": "v{{version}}"}' https://api.github.com/repos/nschloe/{{name}}/releases
1111

1212
upload: clean
1313
@if [ "$(git rev-parse --abbrev-ref HEAD)" != "main" ]; then exit 1; fi

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = perfplot
3-
version = 0.9.11
3+
version = 0.9.12
44
author = Nico Schlömer
55
author_email = nico.schloemer@gmail.com
66
description = Performance plots for Python code snippets
@@ -34,8 +34,8 @@ package_dir =
3434
=src
3535
packages = find:
3636
install_requires =
37-
dufte >= 0.2.20
3837
matplotlib
38+
matplotx
3939
numpy
4040
rich
4141
typing_extensions;python_version<"3.8"

src/perfplot/_main.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
except ImportError:
1212
from typing_extensions import Literal
1313

14-
import dufte
1514
import matplotlib.animation as animation
1615
import matplotlib.pyplot as plt
16+
import matplotx
1717
import numpy as np
1818
import numpy.typing as npt
1919
from rich.console import Console
@@ -22,12 +22,12 @@
2222

2323
from ._exceptions import PerfplotError
2424

25-
plt.style.use(dufte.style)
25+
plt.style.use(matplotx.styles.dufte)
2626

2727
# Orders of Magnitude for SI time units in {unit: magnitude} format
2828
si_time = {
2929
"s": 1e0, # second
30-
"ms": 1e-3, # milisecond
30+
"ms": 1e-3, # millisecond
3131
"us": 1e-6, # microsecond
3232
"ns": 1e-9, # nanosecond
3333
}
@@ -37,7 +37,7 @@ def _auto_time_unit(time_s: float) -> str:
3737
"""Automatically obtains a readable unit at which to plot :py:attr:`timings` of the
3838
benchmarking process. This is accomplished by converting the minimum measured
3939
execution time into SI second and iterating over the plausible SI time units (s, ms,
40-
us, ns) to find the first one whos magnitude is smaller than the minimum execution
40+
us, ns) to find the first one whose magnitude is smaller than the minimum execution
4141
time.
4242
4343
:rtype: str
@@ -122,7 +122,7 @@ def plot( # noqa: C901
122122
for t, label in zip(scaled_timings, self.labels):
123123
plotfun(self.n_range, t, label=label)
124124

125-
dufte.ylabel(ylabel)
125+
matplotx.ylabel_top(ylabel)
126126
else:
127127
if relative_to is None:
128128
flops = self.flop / self.timings_s
@@ -139,7 +139,7 @@ def plot( # noqa: C901
139139
if relative_to is not None and not logy:
140140
plt.gca().set_ylim(bottom=0)
141141

142-
dufte.legend()
142+
matplotx.line_labels()
143143

144144
def show(self, **kwargs):
145145
self.plot(**kwargs)
@@ -318,8 +318,8 @@ def _b(data, kernel: Callable, repeat: int):
318318
number = int(factor * number) + 1
319319

320320
assert tm is not None
321-
# Only return the minimum time; everthing else just measures how slow the system can
322-
# go.
321+
# Only return the minimum time; everything else just measures how slow the system
322+
# can go.
323323
return np.min(tm)
324324

325325

@@ -385,7 +385,7 @@ def init():
385385
lines.append(plotfun([], [], label=label)[0])
386386

387387
ax.legend()
388-
dufte.ylabel("Runtime [s]")
388+
matplotx.ylabel_top("Runtime [s]")
389389
if xlabel:
390390
ax.set_xlabel(xlabel)
391391
xdata = []

tests/test_perfplot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ def test_no_labels():
6666
[
6767
# Dealing w/ edge-case when timing < nanosecond
6868
# ("ns", 0.125, "auto"),
69-
# Almost a milisecond
69+
# Almost a millisecond
7070
("us", 9.999e5, "auto"),
71-
# Equal exactly to a milisecond
71+
# Equal exactly to a millisecond
7272
("ms", 1e6, "auto"),
7373
# Over 1 second
7474
("s", 1.5e9, "auto"),

0 commit comments

Comments
 (0)