Skip to content

Commit ee57494

Browse files
committed
Address new flake8 errors
1 parent 499f22c commit ee57494

File tree

9 files changed

+26
-24
lines changed

9 files changed

+26
-24
lines changed

docs/1dplots.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@
446446
xlim=(-1, 1), ylim=(-1, 1), title='Step gradations',
447447
xlabel='cosine angle', ylabel='sine angle'
448448
)
449-
ax.colorbar(m, loc='b', maxn=10, label=f'parametric coordinate')
449+
ax.colorbar(m, loc='b', maxn=10, label='parametric coordinate')
450450

451451

452452
# %% [raw] raw_mimetype="text/restructuredtext"

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
'sphinx_copybutton',
7575
'sphinx_automodapi.automodapi', # see: https://github.com/lukelbd/sphinx-automodapi/tree/proplot-mods # noqa
7676
'nbsphinx',
77-
]
77+
]
7878

7979
extlinks = {
8080
'issue': ('https://github.com/lukelbd/proplot/issues/%s', 'GH#'),

proplot/axes/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ def _range_gridspec(self, x):
329329
Return the column or row gridspec range for the axes.
330330
"""
331331
if not hasattr(self, 'get_subplotspec'):
332-
raise RuntimeError(f'Axes is not a subplot.')
332+
raise RuntimeError('Axes is not a subplot.')
333333
ss = self.get_subplotspec()
334334
if hasattr(ss, 'get_active_rows_columns'):
335335
func = ss.get_active_rows_columns
@@ -1180,7 +1180,7 @@ def colorbar(
11801180
ticklocation = kwargs.pop('ticklocation', None) or ticklocation
11811181
if ticklocation is not None and ticklocation != 'bottom':
11821182
warnings._warn_proplot(
1183-
f'Inset colorbars can only have ticks on the bottom.'
1183+
'Inset colorbars can only have ticks on the bottom.'
11841184
)
11851185
kwargs.update({
11861186
'orientation': 'horizontal', 'ticklocation': 'bottom'

proplot/axes/geo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ def projection(self):
760760
def projection(self, map_projection):
761761
import cartopy.crs as ccrs
762762
if not isinstance(map_projection, ccrs.CRS):
763-
raise ValueError(f'Projection must be a cartopy.crs.CRS instance.')
763+
raise ValueError('Projection must be a cartopy.crs.CRS instance.')
764764
self._map_projection = map_projection
765765

766766
# Wrapped methods
@@ -1074,7 +1074,7 @@ def projection(self):
10741074
def projection(self, map_projection):
10751075
import mpl_toolkits.basemap as mbasemap
10761076
if not isinstance(map_projection, mbasemap.Basemap):
1077-
raise ValueError(f'Projection must be a basemap.Basemap instance.')
1077+
raise ValueError('Projection must be a basemap.Basemap instance.')
10781078
self._map_projection = map_projection
10791079

10801080
# Wrapped methods

proplot/axes/plot.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,12 +1315,12 @@ def bar_wrapper(
13151315
# sense do document here; figure out way to move it here?
13161316
if left is not None:
13171317
warnings._warn_proplot(
1318-
f'The "left" keyword with bar() is deprecated. Use "x" instead.'
1318+
'The "left" keyword with bar() is deprecated. Use "x" instead.'
13191319
)
13201320
x = left
13211321
if x is None and height is None:
13221322
raise ValueError(
1323-
f'bar() requires at least 1 positional argument, got 0.'
1323+
'bar() requires at least 1 positional argument, got 0.'
13241324
)
13251325
elif height is None:
13261326
x, height = None, x
@@ -1353,7 +1353,7 @@ def barh_wrapper(
13531353
kwargs.setdefault('orientation', 'horizontal')
13541354
if y is None and width is None:
13551355
raise ValueError(
1356-
f'barh() requires at least 1 positional argument, got 0.'
1356+
'barh() requires at least 1 positional argument, got 0.'
13571357
)
13581358
return self.bar(x=left, height=height, width=width, bottom=y, **kwargs)
13591359

@@ -1521,7 +1521,7 @@ def violinplot_wrapper(
15211521
# Sanitize input
15221522
lw = _not_none(lw=lw, linewidth=linewidth)
15231523
if kwargs.pop('showextrema', None):
1524-
warnings._warn_proplot(f'Ignoring showextrema=True.')
1524+
warnings._warn_proplot('Ignoring showextrema=True.')
15251525
if 'showmeans' in kwargs:
15261526
kwargs.setdefault('means', kwargs.pop('showmeans'))
15271527
if 'showmedians' in kwargs:
@@ -2760,7 +2760,7 @@ def legend_wrapper(
27602760
)
27612761
if overridden:
27622762
warnings._warn_proplot(
2763-
f'Ignoring user input properties '
2763+
'Ignoring user input properties '
27642764
+ ', '.join(map(repr, overridden))
27652765
+ ' for centered-row legend.'
27662766
)
@@ -2780,7 +2780,7 @@ def legend_wrapper(
27802780
ymin, ymax = None, None
27812781
if order == 'F':
27822782
raise NotImplementedError(
2783-
f'When center=True, ProPlot vertically stacks successive '
2783+
'When center=True, ProPlot vertically stacks successive '
27842784
'single-row legends. Column-major (order="F") ordering '
27852785
'is un-supported.'
27862786
)
@@ -3344,6 +3344,7 @@ def _redirect(func):
33443344
be applied on the base axes class, not the basemap axes.
33453345
"""
33463346
name = func.__name__
3347+
33473348
@functools.wraps(func)
33483349
def _wrapper(self, *args, **kwargs):
33493350
if getattr(self, 'name', '') == 'basemap':
@@ -3361,6 +3362,7 @@ def _norecurse(func):
33613362
"""
33623363
name = func.__name__
33633364
func._has_recurred = False
3365+
33643366
@functools.wraps(func)
33653367
def _wrapper(self, *args, **kwargs):
33663368
if func._has_recurred:

proplot/colors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,7 +1097,7 @@ def to_listed(self, samples=10, **kwargs):
10971097
if isinstance(samples, Integral):
10981098
samples = np.linspace(0, 1, samples)
10991099
elif not np.iterable(samples):
1100-
raise TypeError(f'Samples must be integer or iterable.')
1100+
raise TypeError('Samples must be integer or iterable.')
11011101
samples = np.asarray(samples)
11021102
colors = self(samples)
11031103
kwargs.setdefault('name', self.name)
@@ -1818,7 +1818,7 @@ def __init__(
18181818
if not norm:
18191819
norm = mcolors.Normalize()
18201820
elif isinstance(norm, mcolors.BoundaryNorm):
1821-
raise ValueError(f'Normalizer cannot be instance of BoundaryNorm.')
1821+
raise ValueError('Normalizer cannot be instance of BoundaryNorm.')
18221822
elif not isinstance(norm, mcolors.Normalize):
18231823
raise ValueError('Normalizer must be instance of Normalize.')
18241824
extend = extend or 'neither'

proplot/constructor.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ def _mod_colormap(cmap, *, cut, left, right, shift, reverse, samples):
264264
if isinstance(cmap, pcolors.ListedColormap):
265265
if cut is not None:
266266
warnings._warn_proplot(
267-
f"Invalid argument 'cut' for ListedColormap. Ignoring."
267+
"Invalid argument 'cut' for ListedColormap. Ignoring."
268268
)
269269
cmap = cmap.truncate(left=left, right=right)
270270
else:
@@ -415,7 +415,7 @@ def Colormap(
415415
# how to make colormaps cyclic.
416416
if not args:
417417
raise ValueError(
418-
f'Colormap() requires at least one positional argument.'
418+
'Colormap() requires at least one positional argument.'
419419
)
420420
if listmode not in ('listed', 'linear', 'perceptual'):
421421
raise ValueError(
@@ -1305,7 +1305,7 @@ def Proj(name, basemap=None, **kwargs):
13051305
import mpl_toolkits.basemap as mbasemap
13061306
if _version_mpl >= _version('3.3'):
13071307
raise RuntimeError(
1308-
f'Basemap is no longer maintained and is incompatible with '
1308+
'Basemap is no longer maintained and is incompatible with '
13091309
'matplotlib >= 3.3. Please use cartopy as your cartographic '
13101310
'plotting backend or downgrade to matplotlib <=3.2.'
13111311
)
@@ -1333,7 +1333,7 @@ def Proj(name, basemap=None, **kwargs):
13331333
kwproj.pop('central_latitude', None)
13341334
if 'boundinglat' in kwproj:
13351335
raise ValueError(
1336-
f'"boundinglat" must be passed to the ax.format() command '
1336+
'"boundinglat" must be passed to the ax.format() command '
13371337
'for cartopy axes.'
13381338
)
13391339
if crs is None:

proplot/demos.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ def show_channels(
279279
"""
280280
# Figure and plot
281281
if not args:
282-
raise ValueError(f'At least one positional argument required.')
282+
raise ValueError('At least one positional argument required.')
283283
array = [[1, 1, 2, 2, 3, 3]]
284284
labels = ('Hue', 'Chroma', 'Luminance')
285285
if saturation:

proplot/figure.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,9 @@ def __init__(
254254
spanx = _not_none(spanx, span, 0 if sharex == 0 else None, rc['span'])
255255
spany = _not_none(spany, span, 0 if sharey == 0 else None, rc['span'])
256256
if spanx and (alignx or align):
257-
warnings._warn_proplot(f'"alignx" has no effect when spanx=True.')
257+
warnings._warn_proplot('"alignx" has no effect when spanx=True.')
258258
if spany and (aligny or align):
259-
warnings._warn_proplot(f'"aligny" has no effect when spany=True.')
259+
warnings._warn_proplot('"aligny" has no effect when spany=True.')
260260
alignx = _not_none(alignx, align, rc['align'])
261261
aligny = _not_none(aligny, align, rc['align'])
262262
self.set_alignx(alignx)
@@ -483,8 +483,8 @@ def _align_labels_axis(self, b=True):
483483
grp.join(axs[0], ax)
484484
elif align:
485485
warnings._warn_proplot(
486-
f'Aligning *x* and *y* axis labels required '
487-
f'matplotlib >=3.1.0'
486+
'Aligning *x* and *y* axis labels required '
487+
'matplotlib >=3.1.0'
488488
)
489489
if not span:
490490
continue
@@ -813,7 +813,7 @@ def _insert_row_column(
813813
gridspec_ss._subplot_spec = subplotspec_new
814814
else:
815815
raise ValueError(
816-
f'Unexpected GridSpecFromSubplotSpec nesting.'
816+
'Unexpected GridSpecFromSubplotSpec nesting.'
817817
)
818818
ax.update_params()
819819
ax.set_position(ax.figbox)

0 commit comments

Comments
 (0)