@@ -21,7 +21,7 @@ def plot_func(ax, x, y, ls="x", label=None, w="xyz"):
21
21
22
22
23
23
@_preprocess_data (replace_names = ["x" , "y" ], label_namer = "y" ,
24
- positional_parameter_names = ["x" , "y" , "ls" , "label" , "w" ])
24
+ positional_parameter_names = ["x" , "y" , "ls" , "label" , "w" ])
25
25
def plot_func_varags (ax , * args , ** kwargs ):
26
26
all_args = [None , None , "x" , None , "xyz" ]
27
27
for i , v in enumerate (args ):
@@ -287,18 +287,17 @@ def funcy(ax, *args, **kwargs):
287
287
list (x ), list (y ), ls , w , label )
288
288
289
289
func = _preprocess_data (replace_all_args = True , replace_names = ["w" ],
290
- label_namer = "y" )(funcy )
290
+ label_namer = "y" )(funcy )
291
291
292
292
assert (func (None , "a" , "b" , w = "x" , label = "" , data = data ) ==
293
293
"x: [1, 2], y: [8, 9], ls: x, w: xyz, label: " )
294
294
assert (func (None , "a" , "b" , w = "x" , label = "text" , data = data ) ==
295
295
"x: [1, 2], y: [8, 9], ls: x, w: xyz, label: text" )
296
296
297
297
func2 = _preprocess_data (replace_all_args = True , replace_names = ["w" ],
298
- label_namer = "y" ,
299
- positional_parameter_names = ["x" , "y" , "ls" ,
300
- "label" , "w" ])(
301
- funcy )
298
+ label_namer = "y" ,
299
+ positional_parameter_names = ["x" , "y" , "ls" ,
300
+ "label" , "w" ])(funcy )
302
301
303
302
assert (func2 (None , "a" , "b" , w = "x" , data = data ) ==
304
303
"x: [1, 2], y: [8, 9], ls: x, w: xyz, label: b" )
@@ -364,7 +363,7 @@ def test_positional_parameter_names_as_function():
364
363
from matplotlib .axes ._axes import _plot_args_replacer
365
364
366
365
@_preprocess_data (replace_names = ["x" , "y" ],
367
- positional_parameter_names = _plot_args_replacer )
366
+ positional_parameter_names = _plot_args_replacer )
368
367
def funcy (ax , * args , ** kwargs ):
369
368
return "{args} | {kwargs}" .format (args = args , kwargs = kwargs )
370
369
0 commit comments