1111except ImportError :
1212 from typing_extensions import Literal
1313
14- import dufte
1514import matplotlib .animation as animation
1615import matplotlib .pyplot as plt
16+ import matplotx
1717import numpy as np
1818import numpy .typing as npt
1919from rich .console import Console
2222
2323from ._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
2828si_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 = []
0 commit comments